If a mail want to select from a person in the address book and only the mail properties should be visible, so I can define by the property displayedProperties of the class ABPeoplePickerNavigationController.
bookNavi.displayedProperties = [NSNumber(int: kABPersonEmailProperty)]
If I want to copy the image of the person after the selection, I need following function:
var imageData:NSData?
if ABPersonHasImageData(person) {
imageData = ABPersonCopyImageDataWithFormat(person, kABPersonImageFormatThumbnail).takeRetainedValue()
}
And now to the question. If displayedProperties is defined, then the function ABPersonHasImageData returns false. If displayedProperties is not defined, then the function returns true. But the other properties like kABPersonFirstNameProperty or kABPersonLastNameProperty are always not null. How can I define the properties and query the profile picture?
Aucun commentaire:
Enregistrer un commentaire