-->

IOS Swift - Can't retrive person note from add

2019-05-25 04:34发布

问题:

Any one have any suggestions why i can get firstName, lastname and birthday, However i can't retrieved the notes filed from iphone address book ?

Preprations

  • Address book access is granted
  • Person added in address book with all fields including note

Current Results

nil for note only, all other fields retrieved correctly

Sample code used

var firstName: String = ABRecordCopyValue(person, kABPersonFirstNameProperty).takeRetainedValue() as NSString
var lastName: String = ABRecordCopyValue(person, kABPersonLastNameProperty).takeRetainedValue() as NSString
let birthday = ABRecordCopyValue(person, kABPersonBirthdayProperty)?.takeRetainedValue() as NSDate?
let notes    = ABRecordCopyValue(person, kABPersonNoteProperty)?.takeRetainedValue() as NSString?