Quote:
Originally Posted by jsd
I got it to work. In the first view controller, do this to launch the modal nav:
Code:
ModalViewController *modal = [[ModalViewController alloc] init];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:modal];
[self presentModalViewController:nav animated:YES];
[modal release];
then, in the one that is loaded, do this:
Code:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
self.title=@"hi mom";
// Custom initialization
}
return self;
}
works for me. the modal view controller slides in with a nav bar containing "hi mom" as the title. let me know if you want me to send you the full xcode project.
|
Thanks jsd. That probably works, but it doesn't solve my problem as it will set the title when the view is loaded. I want to set the title when the view appears as I use the same view for adding new items and for editing existing ones. The solution described above works for me though, kludgy though it may be.