viezel/TiSocial.Framework

Runtime error for iPad, iOS 8.4

Closed this issue · 8 comments

Hello everybody,

I was trying to fix a phone issue (the orientation locking, mentioned in #146 ) so I forked the repository and fixed it. I was planning on send a merge request with that but then I discovered an iPad issue when using activityPopover.

I'm passing a bar button as a view and I can see in the console that it's being properly parsed as the proxy bar button item class.

But for some reason I keep getting the same error.

Terminating app due to uncaught exception 'NSGenericException', reason: 'UIPopoverPresentationController (<_UIAlertControllerActionSheetRegularPresentationController: 0x7fc7a874bd90>) should have a non-nil sourceView or barButtonItem set before the presentation occurs.'

This happens with 1.8.2, even if I pull it again and don't try to recompile the static library.

I even tried solutions as the ones mentioned here: http://stackoverflow.com/questions/25644054/uiactivityviewcontroller-crashing-on-ios8-ipads
...and created fake sourceViews or buttons for the UIPopoverPresentationController.
Still no luck.

Using Xcode 6.4, iOS 8.4, Titanium SDK 4.1.0.GA.

Is this happening to anybody else?

Thanks for the help!

This is the actual output with 1.8.2, on the environment I described already.

[ERROR] : The application has crashed with an uncaught exception 'NSGenericException'.
[ERROR] : Reason:
[ERROR] : UIPopoverPresentationController (<_UIAlertControllerActionSheetRegularPresentationController: 0x79a963d0>) should have a non-nil sourceView or barButtonItem set before the presentation occurs.
[ERROR] : Stack trace:
[ERROR] :
[ERROR] : 0 CoreFoundation 0x0577c72a __exceptionPreprocess + 154
[ERROR] : 1 libobjc.A.dylib 0x04f99a97 objc_exception_throw + 44
[ERROR] : 2 UIKit 0x027ebee2 -[UIPopoverPresentationController presentationTransitionWillBegin] + 3086
[ERROR] : 3 UIKit 0x02102124 __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke + 1549
[ERROR] : 4 UIKit 0x021001f7 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 198
[ERROR] : 5 UIKit 0x021352cb __40+[UIViewController _scheduleTransition:]_block_invoke + 18
[ERROR] : 6 UIKit 0x01fee812 ___afterCACommitHandler_block_invoke + 15
[ERROR] : 7 UIKit 0x01fee7bd _applyBlockToCFArrayCopiedToStack + 415
[ERROR] : 8 UIKit 0x01fee5d2 _afterCACommitHandler + 549
[ERROR] : 9 CoreFoundation 0x0569d86e CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 30
[ERROR] : 10 CoreFoundation 0x0569d7b0 **CFRunLoopDoObservers + 400
[ERROR] : 11 CoreFoundation 0x056931ea __CFRunLoopRun + 1226
[ERROR] : 12 CoreFoundation 0x05692a5b CFRunLoopRunSpecific + 443
[ERROR] : 13 CoreFoundation 0x0569288b CFRunLoopRunInMode + 123
[ERROR] : 14 GraphicsServices 0x0663d2c9 GSEventRunModal + 192
[ERROR] : 15 GraphicsServices 0x0663d106 GSEventRun + 104
[ERROR] : 16 UIKit 0x01fc40b6 UIApplicationMain + 1526
[ERROR] : 17 Outlook 0x000791b8 main + 408
[ERROR] : 18 libdyld.dylib 0x062cdac9 start + 1
[ERROR] :
[ERROR] : 2015-09-03 01:01:39.754 Outlook[48203:1409045] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'UIPopoverPresentationController (<_UIAlertControllerActionSheetRegularPresentationController: 0x79a963d0>) should have a non-nil sourceView or barButtonItem set before the presentation occurs.'
[ERROR] : * First throw call stack:
[ERROR] : (
[ERROR] : 0 CoreFoundation 0x0577c746 __exceptionPreprocess + 182
[ERROR] : 1 libobjc.A.dylib 0x04f99a97 objc_exception_throw + 44
[ERROR] : 2 UIKit 0x027ebee2 -[UIPopoverPresentationController presentationTransitionWillBegin] + 3086
[ERROR] : 3 UIKit 0x02102124 __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke + 1549
[ERROR] : 4 UIKit 0x021001f7 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 198
[ERROR] : 5 UIKit 0x021352cb __40+[UIViewController _scheduleTransition:]_block_invoke + 18
[ERROR] : 6 UIKit 0x01fee812 ___afterCACommitHandler_block_invoke + 15
[ERROR] : 7 UIKit 0x01fee7bd _applyBlockToCFArrayCopiedToStack + 415
[ERROR] : 8 UIKit 0x01fee5d2 _afterCACommitHandler + 549
[ERROR] : 9 CoreFoundation 0x0569d86e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION
+ 30
[ERROR] : 10 CoreFoundation 0x0569d7b0 __CFRunLoopDoObservers + 400
[ERROR] : 11 CoreFoundation 0x056931ea __CFRunLoopRun + 1226
[ERROR] : 12 CoreFoundation 0x05692a5b CFRunLoopRunSpecific + 443
[ERROR] : 13 CoreFoundation 0x0569288b CFRunLoopRunInMode + 123
[ERROR] : 14 GraphicsServices 0x0663d2c9 GSEventRunModal + 192
[ERROR] : 15 GraphicsServices 0x0663d106 GSEventRun + 104
[ERROR] : 16 UIKit 0x01fc40b6 UIApplicationMain + 1526
[ERROR] : 17 Outlook 0x000791b8 main + 408
[ERROR] : 18 libdyld.dylib 0x062cdac9 start + 1
[ERROR] : )
[ERROR] : libc++abi.dylib: terminating with uncaught exception of type NSException

...already visible on other issues but worth showing.

nuno commented

Same here!

The only thing I could do was to rollback to the previous implementation on 1.8.0, and comment the one that was added later and currently active on 1.8.2
That is, basically, adding back the presentPopoverFromBarButtonItem method, and commenting the iOS 8 section.
This works everywhere for me, for some reason. Titanium, I guess.

screen shot 2015-10-24 at 11 57 48 am

abada commented

Same here!

@JuanP6 Please check the latest v1.8.4 update and close this issue if its fixed.

As soon as I have a chance I'll check and let you know!
Thanks

Hey @hansemannn!
I was testing v.1.8.4 and it's not crashing anymore on iPad.
But the overlay now appears on coordinates (0,0), instead of relative to the button passed as parameter.

@JuanP6 Please make sure to implement the bar button as described in #156.