• 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: viewWillAppear not called with UINavigationController containment
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: viewWillAppear not called with UINavigationController containment


  • Subject: Re: viewWillAppear not called with UINavigationController containment
  • From: Curt Clifton <email@hidden>
  • Date: Tue, 27 Dec 2011 10:24:09 -0800

On Dec 27, 2011, at 5:51 AM, Roland King wrote:

> 	// tell each of the controllers we're adding that they are being added and prepare the ones being removed for removal
> 	for( UIViewController *controller in appearingControllers )
> 		[ self addChildViewController:controller ];
> 	[ disappearingControllers makeObjectsPerformSelector:@selector( willMoveToParentViewController: ) withObject:nil ];
>
> 	[ appearingControllers makeObjectsPerformSelector:@selector( didMoveToParentViewController: ) withObject:self ];
> 	[ disappearingControllers makeObjectsPerformSelector:@selector( removeFromParentViewController ) ];
>
> 	// get the views in order
> 	NSArray *newViews = [ viewControllers valueForKey:@"view" ];
>
> 	// views then added to our view

That looks about like what we're doing successfully. The only difference I see is that we're adding/removing views between the paired view controller calls. In the example below, both self and slice are UIViewController subclasses.

	// removing

	[slice willMoveToParentViewController:nil];
	if ([slice isViewLoaded] && slice.view.superview == view)
		[slice.view removeFromSuperview];
	[slice removeFromParentViewController];

	...

	// adding

	[self addChildViewController:slice];
	[view addSubview:slice.view];
	[slice didMoveToParentViewController:self];

HTH.

Cheers,

Curt

_______________________________________________

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

References: 
 >viewWillAppear not called with UINavigationController containment (From: Roland King <email@hidden>)

  • Prev by Date: Re: AVPlayerLayer on Lion will only play one movie then zaps super layer
  • Next by Date: Get the RSS Feed of a site
  • Previous by thread: viewWillAppear not called with UINavigationController containment
  • Next by thread: 360MacDev Conference Room Split?
  • Index(es):
    • Date
    • Thread