Martin Cowie
Martin Cowie

Reputation: 2601

Discovering the user's first and last names?

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.

Upvotes: 1

Views: 327

Answers (2)

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.

Upvotes: 2

Vladimir
Vladimir

Reputation: 170849

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

Upvotes: 2

Related Questions