abrecordref

Storing ABRecordRef in Core Data

淺唱寂寞╮ 提交于 2019-12-21 17:56:35
问题 I would like to store a ABRecordRef in a 'Client' entity in core data. I have read in apples documentation that ABRecordRef is a primitive C data type. As far as I am aware, you can only insert objects in core data. With this in mind, what is the best way to store it in core data? I thought about converting it into a NSNumber for storage, but dont know how to convert it back to ABRecordRef for use. I also thought I could just put it in a NSArray/NSSet/NSDictionary on its own just acting as a

Add Contact to Existing Group programatically in iphone

南楼画角 提交于 2019-12-09 23:43:40
问题 I want to add ABRecordRef to existing Group. Some how its not working. Here is my code: -(void)addUsers:(NSMutableArray*)users toGroupID:(ABRecordID)groupID { CFErrorRef error = NULL; ABAddressBookRef addressBookRef = ABAddressBookCreate(); // Get Group ABRecordRef group = ABAddressBookGetGroupWithRecordID(addressBookRef,groupID); for (User *user in users) { int recordId = user.uniqID; ABRecordRef person = ABAddressBookGetPersonWithRecordID(addressBookRef,(ABRecordID)recordId); //add the new

Add Contact to Existing Group programatically in iphone

自闭症网瘾萝莉.ら 提交于 2019-12-04 19:21:37
I want to add ABRecordRef to existing Group. Some how its not working. Here is my code: -(void)addUsers:(NSMutableArray*)users toGroupID:(ABRecordID)groupID { CFErrorRef error = NULL; ABAddressBookRef addressBookRef = ABAddressBookCreate(); // Get Group ABRecordRef group = ABAddressBookGetGroupWithRecordID(addressBookRef,groupID); for (User *user in users) { int recordId = user.uniqID; ABRecordRef person = ABAddressBookGetPersonWithRecordID(addressBookRef,(ABRecordID)recordId); //add the new person to the record ABAddressBookAddRecord(addressBookRef, person, nil); ABAddressBookSave

Storing ABRecordRef in Core Data

亡梦爱人 提交于 2019-12-04 12:52:13
I would like to store a ABRecordRef in a 'Client' entity in core data. I have read in apples documentation that ABRecordRef is a primitive C data type. As far as I am aware, you can only insert objects in core data. With this in mind, what is the best way to store it in core data? I thought about converting it into a NSNumber for storage, but dont know how to convert it back to ABRecordRef for use. I also thought I could just put it in a NSArray/NSSet/NSDictionary on its own just acting as a wrapper but didnt know if this was silly/inefficient/would even work. Thoughts appreciated. Many thanks

Storing data to NSUserDefaults

倾然丶 夕夏残阳落幕 提交于 2019-11-27 04:40:13
In my iPhone app, I have a class called Contact which consists of an ABRecordRef to serve as a reference to a particular contact. I need to store groups of these contacts in NSUserDefaults , but things aren't working out so well since Contact is a custom class. Any ideas of what to do in this case? You cannot use NSUserDefaults for a custom class. From the documentation: The NSUserDefaults class provides convenience methods for accessing common types such as floats, doubles, integers, Booleans, and URLs. A default object must be a property list, that is, an instance of (or for collections a

Storing data to NSUserDefaults

て烟熏妆下的殇ゞ 提交于 2019-11-26 11:17:59
问题 In my iPhone app, I have a class called Contact which consists of an ABRecordRef to serve as a reference to a particular contact. I need to store groups of these contacts in NSUserDefaults , but things aren\'t working out so well since Contact is a custom class. Any ideas of what to do in this case? 回答1: You cannot use NSUserDefaults for a custom class. From the documentation: The NSUserDefaults class provides convenience methods for accessing common types such as floats, doubles, integers,