开发者

Cocoa Touch get User's full name

开发者 https://www.devze.com 2023-02-12 06:47 出处:网络
I have seen several other Apps getting my full name. I have this set up in 开发者_StackOverflow社区my Address Book, which syncs with my Mac. On My Mac, a card with my name is marked as the \'me\' card

I have seen several other Apps getting my full name. I have this set up in 开发者_StackOverflow社区my Address Book, which syncs with my Mac. On My Mac, a card with my name is marked as the 'me' card. How do the iOS apps get this card, and then extract the full name from it? I've never worked with the AddressBook framework on iOS, and have not done too much on the Mac, besides showing a person picker (which I also will need to figure out sooner or later ;)

Any pointers in the right directions, or just quick tutorials or something of the sort on the iOS AddressBook framework will help.


I made a function that extracts a name from the device name.

Slightly off topic, but I hope this can help people looking for the same thing as I did when finding your question.

Better way to get the user's name from device?


Hey There! I don't know if the association to your "me" card from the Mac is syncronised with an iPhone. (What would it be if the user is a Windows user?) But I think you could be interested in the following two functions.

NSUserName();
NSFullUserName();

I think they'll give you what you need. ;-)

Sandro Meier

0

精彩评论

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