I'm having an issue. ABUnknownPersonViewController is embedded in a navigation controller at the top view, however, I'm not using the navigation bar in my app. When pushing to the ABUnknownPersonView, I don't get the navigation bar or the back button. My solution was this:
ABUnknownPersonViewController *unknownPersonViewController = [[ABUnknownPersonViewController alloc] init];
unknownPersonViewController.displayedPerson = (ABRecordRef)[self buildContactDetails];
unknownPersonViewController.allowsAddingToAddressBook = YES;
unknownPersonViewController.unknownPersonViewDelegate = self;
UINavigationBar *navBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 41)]; navBar.delegate = self;
UINavigationItem *backItem = [[UINavigationItem alloc] initWithTitle:@"Back"];
[navBar pushNavigationItem:backItem animated:NO];
UINavigationItem *topItem = [[UINavigationItem alloc] initWithTitle:@"Your Title"];
[navBar pushNavigationItem:topItem animated:NO];
topItem.leftBarButtonItem = nil;
[unknownPersonViewController.view addSubview:navBar];
[self.navigationController pushViewController:unknownPersonViewController animated:YES];
So this adds in a navigation bar, but the back button doesn't do anything except change the title to 'Back'...very helpful lol. Additionally, there are no bounds to my navigation bar in the top, so I'm having a bit of difficulty...images below