iphoneaddressbookaddressbookui

how to add custom bar button item to navigation bar in AddressBookUI application like edit in place of cancel


I can not understand why navigation bar is not going to add any button other than cancel button in Following code this kind of thing done in Viber application so it is possible

 ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController     alloc] init];
picker.navigationBar.tintColor=[UIColor colorWithRed:91.0/256.0 green:72.0/256.0 blue:110.0/256.0 alpha:1.0];
//picker.navigationController.navigationBar.topItem.rightBarButtonItem = nil;
[picker.navigationBar setHidden:NO];
picker.peoplePickerDelegate = self;
// Display only a person's phone, email, and birthdate
NSArray *displayedItems = [NSArray arrayWithObjects:[NSNumber numberWithInt:kABPersonPhoneProperty], 
                           [NSNumber numberWithInt:kABPersonEmailProperty],
                           [NSNumber numberWithInt:kABPersonBirthdayProperty], nil];

//picker.navigationBarHidden=TRUE;
picker.displayedProperties = displayedItems;
//UIBarButtonItem *addbutton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(AddContact)];          
   //   picker.navigationController.navigationBar.topItem.rightBarButtonItem = addbutton;

[self presentModalViewController:picker animated:NO];
[picker release];
//[addbutton release];

can anybody help please


Solution

  • refer this article it demonstrates how to add custom button on ABPeoplePickerNavigationController