I would like to run the modal view controller in the same way as with "ABPeoplePickerNavigationController", and it does not need to create a navigation controller containing a view controller.
Doing something like this gives a blank screen without a title for the navigation bar, and there is no associated nib file loaded for presentation, although I call initWithNibName when init is called.
My controller looks like this:
@interface MyViewController : UINavigationController @implementation MyViewController - (id)init { NSLog(@"MyViewController init invoked"); if (self = [super initWithNibName:@"DetailView" bundle:nil]) { self.title = @"All Things"; } return self; } - (void)viewDidLoad { [super viewDidLoad]; self.title = @"All Things - 2"; } @end
When using the AB controller, all you do is:
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init]; picker.peoplePickerDelegate = self; [self presentModalViewController:picker animated:YES]; [picker release];
ABPeoplePickerNavigationController is declared as:
@interface ABPeoplePickerNavigationController : UINavigationController
Another way to create a modal view, as suggested in the Apple View View Programming Guide for iPhone OS ':
I can create it this way perfectly (as long as I change MyViewController to inherit with UIViewController instead of UINavigationController). What else should I do with MyViewController to run in the same way as ABPeoplePickerNavigationController?
iphone
Alexi groove
source share