开发者

How to display only phone number in contact list in iPhone?

I opened default contact list in my iPhone app.

Now I want when开发者_如何学JAVA I select any contact it should display only phone number of that contact and not any other info.

If that contact has no phone number then it should be display only "No Phone Number".

How to achieve this?


The ABPersonViewController has a displayedProperties property, where you can define what to display.

ABPersonViewController *controller = [[ABPersonViewController alloc] init];

NSArray *properties =
    [NSArray arrayWithObjects:
     [NSNumber numberWithInt:kABPersonPhoneProperty], nil]
[controller setDisplayedProperties:properties];


When you select any of the contact, there is one delegate method is called,

peoplePickerNavigationController:shouldContinueAfterSelectingPerson:

You just need to set displayedProperties, where you can set the Phone number only,

May this link help you more http://developer.apple.com/library/ios/#documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/Chapters/UI_Controllers.html%23//apple_ref/doc/uid/TP40007744-CH5-SW1

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜