Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LaunchServices: invalidationHandler called - iOS 8 share sheet

Tags:

Seeing this error message in the logs, though not consistently, around the time that I use SLComposeViewController to open a Twitter or Facebook share sheet. I am not using any new iOS 8 API, just testing existing code on iOS 8. I see others have had this problem and even seen crashes when using other modal view controllers from the Cocoa Touch SDK.

LaunchServices: invalidationHandler called

Are there new precautions to take with SLComposeViewController and UIActivityViewController in iOS 8? Something else to consider?

like image 365
Kyle Clegg Avatar asked Sep 10 '14 07:09

Kyle Clegg


1 Answers

Add this code after you present your activity view controller:

if ([activityVC respondsToSelector:@selector(popoverPresentationController)]) {     // iOS 8+     UIPopoverPresentationController *presentationController = [activityVC popoverPresentationController];      presentationController.sourceView = sender; // if button or change to self.view. } 
like image 111
Ram G. Avatar answered Dec 15 '22 00:12

Ram G.