Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View Controller containment is broken #23

Open
ankorko opened this issue Mar 28, 2015 · 1 comment
Open

View Controller containment is broken #23

ankorko opened this issue Mar 28, 2015 · 1 comment

Comments

@ankorko
Copy link

ankorko commented Mar 28, 2015

UIViewController lifecycle events (view[Will | Did][Load | Appear | Disappear]) should not be sent manually but handled with the View Controller Containment API (willMoveToParentViewController, addChildViewController, didMoveToParentViewController)

@mengjang
Copy link

+1 Lifecycycle events should not be set manually. Otherwise, say, ViewDidLoad would be called twice. The funny thing is that if I just comment out the following line, the screen will go black.
// [self notifyControllers:NSSelectorFromString(@"viewDidLoad")
object:nil
checkIndex:NO];

If I comment out everything in notifyControllers, my app works fine with everything rendered on the screen properly.

-(void)notifyControllers:(SEL)selector object:(id)object checkIndex:(BOOL)index{
// if(index && self.childViewControllers.count > self.indexSelected) {
// [(UIViewController_)self.childViewControllers[self.indexSelected] performSelectorOnMainThread:selector
// withObject:object
// waitUntilDone:NO];
// }
// else{
// [self.childViewControllers enumerateObjectsUsingBlock:^(UIViewController_ ctr, NSUInteger idx, BOOL *stop) {
// [ctr performSelectorOnMainThread:selector
// withObject:object
// waitUntilDone:NO];
// }];
// }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants