Get User Account Image

后端 未结 3 1067
故里飘歌
故里飘歌 2020-12-15 14:09

Simply: how do I get the user\'s account image?

I\'m using Cocoa on Mac.

3条回答
  •  渐次进展
    2020-12-15 14:49

    If you only want an image for the logged-in user, it's also possible to get it with a one-liner using AddressBook:

    NSData *imgData = [[[ABAddressBook sharedAddressBook] me] imageData];
    

    but I believe that this is not guaranteed to be the same as the log-in image.

提交回复
热议问题