开发者

iphone addressbook saving link to a contact

开发者 https://www.devze.com 2022-12-18 05:28 出处:网络
in my iphone app, I\'m wishing to link a contact to a data-piece in an array. All the data handling is fine. My question is: what contact info parameter can be saved in a database, acting as a link to

in my iphone app, I'm wishing to link a contact to a data-piece in an array. All the data handling is fine. My question is: what contact info parameter can be saved in a database, acting as a link to a contact. Then later I will be able to call this one value and then get the link back to the contact.

---EDIT BELOW

This is where I am up to, but I just cant get it right yet. I get the contact view sliding over, but it contains an empty contact. Can someone please help.

ABPersonViewController *p开发者_高级运维vc = [[ABPersonViewController alloc] init];

int referenceid = 69249600;


ABAddressBookRef addressBook;
addressBook = ABAddressBookCreate();
ABRecordRef person = ABAddressBookGetPersonWithRecordID(addressBook, referenceid);
//ABAddressBookGetPersonWithRecordID()

pvc.displayedPerson = person;

[[self navigationController] pushViewController:pvc animated:YES];  
NSLog(@"customerRecID %d", pvc.displayedPerson);


Yes, ABRecordID is what you want to use. Not sure what you mean by "call this as a variable". If you want to convert an ABRecordRef to an ABRecordID, use ABRecordGetRecordID().

0

精彩评论

暂无评论...
验证码 换一张
取 消