views:

11

answers:

0

The context:

I am working on an app that maintains a list of contacts along with their record IDs for it's own reference.

When the user needs to change the number associated with a specific contact within the app, I am trying to display the ABPersonViewController so the user can choose the new number from the contact in AB.

The problem: The problem is that the ABPersonViewController that is opened is starting all the way from the top of the screen as if it does not know that there is a navigation bar on the top.

As a result some of the top part of the ABPersonViewController screen (the top part of the person image and the top part of the name) is underneath the navigation bar.

Ideally i want it to look like this, but not in edit mode: http://developer.apple.com/library/ios/documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/Art/person_view.jpg

Also I wanted to add a "cancel" button to the top right part of the nav bar. Trying to add that as a bar button is not working either.

The code: this is how I am adding the ABPersonViewController to the navigationController:

ABPersonViewController *personViewController = [[ABPersonViewController alloc] init];
personViewController.personViewDelegate = self;
personViewController.displayedPerson = person; 
[self.m_circleNavController pushViewController:personViewController animated:YES];
[personViewController release];

The self here is a UIVIewController.

The m_circleNavController is the UINavigationController to which the UIVIewController belongs.

I tried these 2 ways of showing the person view, but both behave the same way.

[self.m_circleNavController pushViewController:personViewController animated:YES];

[self.navigationController pushViewController:personViewController animated:YES];

I'm not too sure what I am doing wrong, or what is the best way to do it. I tried a lot of different ways to display it in vain.