I want to show the addressbook as a tabbar item so I defined this code in the delegate for the tab bar:
Contacts = [[ABPeoplePickerNavigationController alloc] init];
Contacts.tabBarItem.image = [UIImage imageNamed:@"Contact.png"];
Contacts.tabBarItem.title = NSLocalizedStringFromTable (@"Label_Contact_String" , language , @"");
//[Contacts.navigationController.navigationBar setBarStyle:UIBarStyleBlack];
Contacts.peoplePickerDelegate = self;
[rootViewController addObject:Contacts];
The contacts list is shown but there is a cancel button in navigation bar that is not useful and I can't remove it from navigation bar. Can you help me? Thanks
The ABPeoplePickerNavigationController
inherits from UINavigationController, so methods that work on UINavigationControllers should work on ABPeoplePickerNavigationController, unless it overrides them, which is highly likely.
You should be able to do this:
Contacts.navigationController.navigationBar.topItem.rightBarButtonItem = nil;
(that's if the cancel button is on the right, if it's on the left, just change right to left)
However it's highly likely you won't be able to and you'll just have to accept the cancel button