0

当我像这样使用地址簿时:

ABAddressBook *ab = [ABAddressBook addressBook];  
ABPerson *person = [[ABPerson alloc]init];  
[person setValue:lastName forProperty:kABLastNameProperty];  
[ab addRecord:person];  
[ab save];

我得到错误:

`Terminating app due to uncaught exception 'NSInvalidArgumentException',reason: '-[__NSCFString count]: unrecognized selector sent to instance 0x1001448a0'`

setValue:forProperty做什么

4

1 回答 1

0

看起来问题出在

-[__NSCFString count]

setValue:forProperty设置属性的值。看起来问题可能是您lastName尝试设置的对象。

于 2013-10-16T10:00:50.807 回答