views:

137

answers:

2

I am trying to programmatically discover the first and last names of the iPhone user. Is this possible at all? Calling this ...

getpwuid( getuid() )->pw_gecos == "Mobile User"

..alas. Iterating over the address book finds all address book records, but doesn't distinguish between the device owner and anyone else (that I can tell).

Given that the Mac desktop address book decorates the owners icon with a 'me' overlay in the bottom-left, I'm hoping that sort of information is available in the iPhone version.

Martin.

+2  A: 

See similar question - there is no public API for that.

Vladimir
+1  A: 

As noted in the other thread, there is NSFullUserName() - this call does come up in the iPhone documentation so it should work on the device. Simply parse out the first and last name from that.

Kendall Helmstetter Gelner