开发者

Use Address Book as Data Source

开发者 https://www.devze.com 2023-01-07 23:47 出处:网络
I am going to use Address Book as my app\'s data source for use to add new contact or select a contact. The contact is mainly for company or organization, but it can be a person.

I am going to use Address Book as my app's data source for use to add new contact or select a contact. The contact is mainly for company or organization, but it can be a person.

For adding a new contact, I would like to show a list of contacts, like people pick control:

alt text http://developer.apple.com/iphone/library/documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/Art/people_picker.jpg

However, I cannot figure out to change Cancel to Add, and Groups as Cancel. It looks like that there is no way I can set this controller' navigation bar to Add. Basically, I would like to display a list of contacts to choose as my add data source, and to provide Add function in the same view if user wants to add new one to the contact first and as data source.

Apple's Address Book Programming Guideline does provide one ABN开发者_开发知识库ewPersonViewController to add a new contact. Is there any way to add this to all contacts picker as its navigation tree? Does any one see similar example codes in Apple's example list(just too many to find out)?

Another related issue is that when the people picker controller is shown, it appears with animation from bottom up. Is there any way to control its animation from left just like navigation drill-down animation?


My recommendation: use a ABPeoplePickerNavigationController and add a toolbar to the bottom that has an Add button. The Add button would open a ABNewPersonViewController.


To do what you’re trying to do you’ll need to create your own controller which populates a table’s cells using the AB API. You can push your controller onto your existing navigation controller to get the animation you want, and use the ABNewPersonViewController to add new entries.

0

精彩评论

暂无评论...
验证码 换一张
取 消