I want to store a ABRecordRef Object i.e in the format of <CPRecord: 0xa2a3500 ABPerson> using Coredata.
While I have tried to store like
NSEntityDescription *entityDescriptionStrings = [NSEntityDescription entityForName:@"ContactsStrings" inManagedObjectContext:context];
ContactsStrings *contactsManagedObjectStrings = [[ContactsStrings alloc] initWithEntity:entityDescriptionStrings insertIntoManagedObjectContext:context];
ABRecordRef recordRef = CFArrayGetValueAtIndex(contactInfoArray, i);
[contactsManagedObjectStrings setValue:(__bridge id)(recordRef) forKey:@"record"];
I am getting a crash saying
record I have taken as Integer32 Datatype.
Terminating app due to uncaught exception NSInvalidArgumentException,
reason: 'Unacceptable type of value for attribute: property = "record"; desired type = NSNumber; given type = __NSCFType; value = .
[NSNumber numberWithInt:(int)recordRef]instead of(__bridge id)(recordRef)- Akhilrajtr