0

I'm using Xcode 7 and when I test the code below, it works perfectly on my iPhone on iOS 8 but when I run it on the iOS 9 simulator, it becomes very glitchy. The iOS 9 simulator shows the pop up options but when I click on mail, I don't see the image or text and when I try to edit the mail through the simulator, I see "MailCompositionService quit unexpectedly" with this error in my log:

viewServiceDidTerminateWithError: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted}

Also, when I test on my iPhone with iOS 8 I get this:

LaunchServices: invalidationHandler called

Here's the code I used:

NSString *texttoshare = [NSString stringWithFormat:@"I just scored %li on the game",(long)HighScoreNumber];;
    UIImage *imagetoshare = [UIImage imageNamed:@"wallpaper8.png"];
    NSArray *activityItems = @[texttoshare, imagetoshare];

    UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];

    //if iPhone
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
        [self presentViewController:controller animated:YES completion:nil];
    }
    //if iPad
    else {
        // Change Rect to position Popover
        UIPopoverController *popup = [[UIPopoverController alloc] initWithContentViewController:controller];
        [popup presentPopoverFromRect:CGRectMake(self.view.frame.size.width/2, self.view.frame.size.height/4, 0, 0)inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    }
MGames
  • 1,171
  • 2
  • 13
  • 24
  • Define "glitchy". In what way exactly isn't the code working as desired with iOS 9? – rmaddy Sep 20 '15 at 18:52
  • @rmaddy I've explained it clearer. Check the edits. – MGames Sep 20 '15 at 19:01
  • Test using Mail on a real device. I see the same error (MailCompositionService quit unexpectedly) in the iOS 9 simulator. – rmaddy Sep 20 '15 at 19:02
  • @rmaddy, I tested it on an iOS 8 iphone 6 (real device) and it works flawlessly but I get an error in my log->. What about this: LaunchServices: invalidationHandler called Would my app get rejected if I sent it with this in my log? – MGames Sep 20 '15 at 19:04
  • See if any of these [search results on the error message](http://stackoverflow.com/search?q=%5Bios%5D+LaunchServices%3A+invalidationHandler+called) help you. – rmaddy Sep 20 '15 at 19:06
  • @rmaddy I don't even know. One post says: http://stackoverflow.com/questions/26183334/uiactivityviewcontroller-launchservices-invalidationhandler-called – MGames Sep 20 '15 at 19:11
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/90174/discussion-between-mgames-and-rmaddy). – MGames Sep 20 '15 at 19:12

0 Answers0