tags:

views:

510

answers:

1

Tried this, but doesn't work:

ABPeoplePickerNavigationController * people_picker = [[ABPeoplePickerNavigationController alloc] init];

people_picker.peoplePickerDelegate = self;

self.navigationController.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle: @"send" 
       style: self.navigationController.navigationItem.rightBarButtonItem.style
      target: self
      action: @selector(cancelAddressBook)] autorelease];

[self.navigationController presentModalViewController: people_picker animated: YES];
A: 

As the people picker is a modal view you need to add the button directly to it, rather than to your nav controller. Try this:

people_picker.navigationBar.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle: @"send" 
   style: self.navigationController.navigationItem.rightBarButtonItem.style
  target: self
  action: @selector(cancelAddressBook)] autorelease];
pheelicks