views:

245

answers:

1

Why my ABPersonViewController is not showing all the properties? Currently it is showing only phone number properties. It is not the e-mail ids, addresses, birth day and other info. My contact has all this info. How the Phonebook's/Contact's ABPersonViewController is showing all this info? And How can I get the "Text Message", "Share Contact" and "Add To Favorites" buttons in my ABPersonViewController?

Any help would be appreciated.

+1  A: 

According to the ABPersonViewController reference, you can set the displayedProperties property of the controller to an NSArray.

Try setting it e.g. to

[NSArray arrayWithObjects:kABPersonEmailProperty,kABPersonBirthdayProperty,nil];

setting whichever properties from the available properties list you want.

Adam Woś
Well, adam thanks for your reply. You're right. Whenever you set the properties to the ABPersonViewController, it displays those properties only to the user. I investigated my code and found that, I set only "phone" num property to the controller.P.S: By default, ABPersonViewController displays all the properties to the users.
prathumca
Glad to be helpful - would appreciate if you marked my answer as accepted ;)
Adam Woś
Sure. Do you have any idea, how to show "Text Message", "Share Contact" and "Add To Favorites" buttons in ABPersonViewController?
prathumca
Not really, no.
Adam Woś
To show the "Text Message" button you must set the "allowsActions" property of the ABUnknownPersonViewController to YES. And to show the "Add to Existing Contact" button (if that's what you meant), you must set the allowsAddingToAddressBook property to YES. Now I know you're working with a ABPersonViewController not an "unknown" one, but maybe this can point you in the right direction.
Andrew