tags:

views:

547

answers:

2

Can I get the usere's mobile number in Objective-C on the iPhone?

+4  A: 

Not with the official SDK. You could ask the user to point to its own contact entry using the AddressBookUI framework's pickers, or a UI of your own design.

millenomi
In fact, ICE (one of the apps in the store) does exactly this - it asks the user to pick themselves out of the contacts.
nsayer
+2  A: 

You can get the user's phone # from NSUserDefaults. And then look up their address book entry.

This method is completely undocumented and liable to break at a moments noticed.

Also it is fragile - user might have a bad address book with the same # used multiple times etc.

schwa