獲得通訊錄中聯絡人的所有屬性

2021-05-31 21:24:52 字數 1571 閱讀 4390

獲得通訊錄中聯絡人的所有屬性

abaddressbookref addressbook = abaddressbookcreate();

cfarrayref results = abaddressbookcopyarrayofallpeople(addressbook);

for(int i = 0; i < cfarraygetcount(results); i++)

//讀取位址多值

abmultivalueref address = abrecordcopyvalue(person, kabpersonaddressproperty);

int count = abmultivaluegetcount(address);

for(int j = 0; j < count; j++)

//獲取dates多值

abmultivalueref dates = abrecordcopyvalue(person, kabpersondateproperty);

int datescount = abmultivaluegetcount(dates);

for (int y = 0; y < datescount; y++)

//獲取kind值

cfnumberref recordtype = abrecordcopyvalue(person, kabpersonkindproperty);

if (recordtype == kabpersonkindorganization) else

//獲取im多值

abmultivalueref instantmessage = abrecordcopyvalue(person, kabpersoninstantmessageproperty);

for (int l = 1; l < abmultivaluegetcount(instantmessage); l++)

//讀取**多值

abmultivalueref phone = abrecordcopyvalue(person, kabpersonphoneproperty);

for (int k = 0; k//獲取url多值

abmultivalueref url = abrecordcopyvalue(person, kabpersonurlproperty);

for (int m = 0; m < abmultivaluegetcount(url); m++)

//讀取**

nsdata *image = (nsdata*)abpersoncopyimagedata(person);

uiimageview *myimage = [[uiimageview alloc] initwithframe:cgrectmake(200, 0, 50, 50)];

[myimage setimage:[uiimage imagewithdata:image]];

myimage.opaque = yes;

[textview addsubview:myimage];

}cfrelease(results);

cfrelease(addressbook);

獲得通訊錄中聯絡人的所有屬性

獲得通訊錄中聯絡人的所有屬性 看 abaddressbookref addressbook abaddressbookcreate cfarrayref results abaddressbookcopyarrayofallpeople addressbook for int i 0 i cfarr...

獲得通訊錄中聯絡人的所有屬性

abaddressbookref addressbook abaddressbookcreate cfarrayref results abaddressbookcopyarrayofallpeople addressbook for int i 0 i cfarraygetcount result...

獲得通訊錄中聯絡人的所有屬性

獲得通訊錄中聯絡人的所有屬性 看 abaddressbookref addressbook abaddressbookcreate cfarrayref results abaddressbookcopyarrayofallpeople addressbook for int i 0 i cfarr...