• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: crashing on "-[UIViewController presentViewController:animated:completion:] " on ios 8
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: crashing on "-[UIViewController presentViewController:animated:completion:] " on ios 8


  • Subject: Re: crashing on "-[UIViewController presentViewController:animated:completion:] " on ios 8
  • From: Herman Chan <email@hidden>
  • Date: Tue, 23 Sep 2014 13:45:43 -0400

Hi David,

Here is my set up in term of view controllers.

- (void) setUpTabbarController {

  self.tabBarController = [[MyTabbarViewController alloc] init];
ViewController *v1 = [[HubActivityViewController alloc] initWithNibName:nil bundle:nil]; ViewController *v2 = [[CalendarContainerViewController alloc] initWithNibName:nil bundle:nil];
  ViewController *v3 = [[HubTaskGroupsViewController alloc] init];

UINavigationController* nav1 = [[UINavigationController alloc] initWithRootViewController:v1]; UINavigationController* nav2 = [[UINavigationController alloc] initWithRootViewController:v2]; UINavigationController* nav3 = [[UINavigationController alloc] initWithRootViewController:v3];

self.tabBarController.viewControllers = [NSArray arrayWithObjects:nav1, nav2, nav3, nil];
  nav1.delegate = self.tabBarController;
  nav2.delegate = self.tabBarController;
  nav3.delegate = self.tabBarController;

self.revealSideViewController = [[PPRevealSideViewController alloc] initWithRootViewController:self.tabBarController]; [self.revealSideViewController setDirectionsToShowBounce:PPRevealSideDirectionNone]; [self.revealSideViewController setPanInteractionsWhenClosed:PPRevealSideInteractionContentView | PPRevealSideInteractionNavigationBar]; [self.revealSideViewController setOption:PPRevealSideOptionsResizeSideView];

  self.window.rootViewController = self.revealSideViewController;

  // set the modal presenting style, possible fix for crash on iOS 8
  if ([Util isRunningIOSEight]) {
self.window.rootViewController.modalPresentationStyle = UIModalPresentationOverFullScreen;
  }
}

We use a library called "PPRevealSideViewController" (https://github.com/ipup/PPRevealSideViewController/commits/master) to provide a slide menu in our app. Whenever we call [self presentViewController:] from on of the view controller inside the tabbarcontroller (i.e.: v1), we get the detached view controller warning.

Do you think the warning is related to the menu library or the way I set up my tabbarcontroller?

Herman


On 23 Sep 2014, at 13:32, David Duncan wrote:

On Sep 22, 2014, at 7:16 PM, Herman Chan <email@hidden> wrote:

Hi Ben,

I have both in my app, both presenting from rootVC and just plain controller. I fish out the rootVC to get rid of warning like this "Presenting view controllers on detached view controllers is discouraged”.

So why do you have detached view controllers in the first place?

Detached view controllers have been discouraged ever since it was possible to setup the parent-child relationship in the first place. I suspect that if you fix your detached view controllers that you will fix this issue too.


I am seeing crash logs from both instance of presenting view controllers (both from rootVC and not), so that's probably not the issue here.

Herman

On 22 Sep 2014, at 22:14, Ben Kennedy wrote:

On 22 Sep 2014, at 6:36 pm, Herman Chan <email@hidden> wrote:

GlobalSettingsViewController *c = [[GlobalSettingsViewController alloc] initWithGroupDataSource:self.dataSource]; navigationController = [[UINavigationController alloc] initWithRootViewController:c]; UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; [vc presentViewController:navigationController animated:YES completion:nil];

Is there a particular reason why you are fishing out the root view controller via the delegate singleton? Does it work properly if your LeftMenuViewController instance (the class which according to your trace is making the call) simply calls presentViewController on itself instead?

b

--
Ben Kennedy, chief magician
Zygoat Creative Technical Services
http://www.zygoat.ca
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

--
David Duncan
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: crashing on "-[UIViewController presentViewController:animated:completion:] " on ios 8
      • From: David Duncan <email@hidden>
References: 
 >crashing on "-[UIViewController presentViewController:animated:completion:] " on ios 8 (From: Herman Chan <email@hidden>)
 >Re: crashing on "-[UIViewController presentViewController:animated:completion:] " on ios 8 (From: Ben Kennedy <email@hidden>)
 >Re: crashing on "-[UIViewController presentViewController:animated:completion:] " on ios 8 (From: Herman Chan <email@hidden>)
 >Re: crashing on "-[UIViewController presentViewController:animated:completion:] " on ios 8 (From: David Duncan <email@hidden>)

  • Prev by Date: Re: crashing on "-[UIViewController presentViewController:animated:completion:] " on ios 8
  • Next by Date: Re: crashing on "-[UIViewController presentViewController:animated:completion:] " on ios 8
  • Previous by thread: Re: crashing on "-[UIViewController presentViewController:animated:completion:] " on ios 8
  • Next by thread: Re: crashing on "-[UIViewController presentViewController:animated:completion:] " on ios 8
  • Index(es):
    • Date
    • Thread