Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top