The ABRecordID
is a synonym (typedef) for int32_t
which is a 32-bit integer. So typecasting is not the proper approach. You want to create an NSNumber
with the value of the id.
ABRecordId rec_id = person.record_id;
NSNumber *wrapper = [NSNumber numberWithInt:(int)rec_id];
and later:
NSNumber *wrapper = ...
ABRecordId rec_id = (ABRecordId)[wrapper intValue];
Please note that bridging and ARC are irrelevant when going to/from ABRecordId and NSNumber. There is no use of any of the CF
types in this case. You'll know when you are using CF
types because you'll have a variable whose type begins with CF
(such as CFArrayRef
).