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
2008-10-01 20:33:24
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
2008-10-01 20:35:15
+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
2008-10-02 03:27:12