我正在尝试为联系人(ABAddressBook iOS)设置 kABPersonType 值。
ABRecordSetValue(person, kABPersonType, [currentContact personType], nil);//person type (individual or company
[currentContact personType] 是一个 NSNumber。
当我们到达 ABAddressBookSave 时会抛出一个错误。
如下;
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFNumber length]: unrecognized selector sent to instance 0x6805ff0'
在所有其他情况下;例如
ABRecordSetValue(person, kABPersonNoteProperty, [currentContact note], nil);
属性设置没问题。
任何想法为什么会发生这种情况?
干杯,
富有的