开发者

Discovering the user's first and last names?

开发者 https://www.devze.com 2022-12-11 08:16 出处:网络
I am trying to programmatically discover the first and last names of the iPhone user. Is this possible at all? Calling this ...

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 开发者_如何学JAVAsort of information is available in the iPhone version.

Martin.


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号