ios - Setting kABPersonType -


i'm trying set kabpersontype value contact (abaddressbook ios).

abrecordsetvalue(person, kabpersontype, [currentcontact persontype], nil);//person type (individual or company 

[currentcontact persontype] nsnumber.

an error gets thrown when reach abaddressbooksave.

as follows;

*** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[nscfnumber length]: unrecognized selector sent instance 0x6805ff0' 

in other cases; e.g.

abrecordsetvalue(person, kabpersonnoteproperty, [currentcontact note], nil);

the setting of properties fine.

any ideas why happening?

cheers,

rich

you cannot set record's record type. record type determined type of record create (abpersoncreate() or abgroupcreate()) , cannot changed later.

if mean set person record kind (to person or company) instead, have use correct constants: kabpersonkindproperty second argument, , value argument (nsnumber) must contain kabpersonkindperson.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -