ParentViewController returns nil
Posted
by
Andreas Johannessen
on Stack Overflow
See other posts from Stack Overflow
or by Andreas Johannessen
Published on 2011-01-02T13:34:16Z
Indexed on
2011/01/02
14:54 UTC
Read the original article
Hit count: 192
iphone
Hi
I know there are many questions on this, but I don't get it to work.
I present a UITabBarController with the presentModalViewController. However when I try to get title from the navigationItem title attribute in the UINavigationController class that presents the tabcontroller, it returns nil no matter what I do. I have the NSLog in the viewDidLoad method in tabcontroller class.
I also cast the UIViewController which is returned by the self.parentViewController property. Then I try to access the title through: NSLog(@"%@", castedViewController.navigationItem.title);
Any suggestions?
© Stack Overflow or respective owner