2014-09-24 87 views
11

我的應用程序(僅適用於iOS 8)因嘗試IAP時發生崩潰而被拒絕。我已經在AdHoc構建中嘗試了幾乎所有購買過程的咒語,但無法重現崩潰。查看審查小組附加的崩潰日誌,我在最後一次異常回溯中看到了一個非常奇怪的堆棧跟蹤。該崩潰看起來涉及UIPopoverController,但是我的應用程序雖然是通用的,但並不顯式或隱式地在任何地方顯示彈出窗口。有沒有人有任何想法可能觸發導致這次崩潰的活動?當審覈團隊只查看它時,什麼可能會導致我的應用顯示彈出窗口?應用程序在UIPopoverPresentationController中崩潰但沒有顯式彈出?

Last Exception Backtrace: 
0 CoreFoundation    0x186d52084 __exceptionPreprocess + 132 
1 libobjc.A.dylib    0x1977a40e4 objc_exception_throw + 60 
2 UIKit       0x18bc0aee0 -[UIPopoverPresentationController presentationTransitionWillBegin] + 2464 
3 UIKit       0x18b7d27d8 __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke + 1324 
4 UIKit       0x18b7d1310 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 212 
5 UIKit       0x18b557388 _applyBlockToCFArrayCopiedToStack + 356 
6 UIKit       0x18b4c8e4c _afterCACommitHandler + 532 
7 CoreFoundation    0x186d0a388 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32 
8 CoreFoundation    0x186d07314 __CFRunLoopDoObservers + 360 
9 CoreFoundation    0x186d076f4 __CFRunLoopRun + 836 
10 CoreFoundation    0x186c35664 CFRunLoopRunSpecific + 396 
11 GraphicsServices    0x18fd435a4 GSEventRunModal + 168 
12 UIKit       0x18b53a984 UIApplicationMain + 1488 
+2

您是否在任何點顯示UIActivityViewController?如果是這樣,你可能[在iPad上顯示時崩潰](http://stackoverflow.com/questions/25644054/uiactivityviewcontroller-crashing-on-ios8-ipads)。在iOS8中似乎Apple會在此顯示隨機位的UI。尋找你展示UIViewController的地方,並嘗試在VC的'popoverPresentationController'屬性上設置所需的信息。哪個只是iOS8,所以你需要檢查它是否響應該選擇器。 – 2014-09-24 14:42:28

+0

我確實介紹了一個活動視圖控制器,但在應用程序被拒絕時他們正在引用的流程中沒有任何地方。我也不清楚爲什麼這隻會在應用程序審查下出現問題,而不是在AdHoc發佈版本中。 – nickbona 2014-09-24 15:01:50

+0

這可能是你捕捉到你的構建異常,但蘋果打破了異常拋出點?我無法說出蘋果是怎麼做的,但我想你可能沒有在iPad上測試過? *不應該在adhoc發行版上有所不同,所以如果您的活動視圖控制器在本地爲iPad工作,那肯定不是問題。但就像我說的,你的一個視圖控制器正在結束這個演示文稿popover thingy。 – 2014-09-24 19:54:12

回答

-2

首先您應該檢查UIPopoverPresentationController是否可用。

NSArray *Items = [NSArray arrayWithObjects:emailBody,anImage, nil]; 

    UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:Items applicationActivities:nil]; 

    if ([UIPopoverPresentationController class] != nil) { 
     UIPopoverPresentationController *popover = activityController.popoverPresentationController; 
     if (popover) 
     { 
      popover.sourceView = sender; 
      //popover.sourceRect = sender.bounds; 
      popover.permittedArrowDirections = UIPopoverArrowDirectionAny; 
     } 
    } 


    [self presentViewController:activityController animated:YES completion:NULL]; 
+0

請提供對您的代碼的解釋 – arghtype 2014-11-06 06:22:40

+0

UIPopoverPresentationController類未在ipad-ios8或更高版本中找到編譯器,所以應用程序崩潰。所以首先我們檢查UIPopoverPresentationController類是否可用 – 2014-11-06 06:37:31

4

不知道,如果是相同的原因是原題,但我有完全相同的錯誤,並用這一問題的UIAlertController與ActionSheet風格,呈現它工作得很好的iPhone,但iPad的需要sourceview到被設置 - https://stackoverflow.com/a/24233937/285694

相關問題