I want to create an array of ABRecordRef(s) to store contacts which have a valid birthday field.
NSMutableArray* bContacts = [[NSMutableArray alloc] init
A ABRecordRef
is a typedef for CFTypeRef
and that in turn resolves to const void *
. And this is where the warning comes from: with the call to addObject:
, the const
qualifier is "lost".
In this case we know it's OK. A CFTypeRef is a semi-highlevel type, instances of this type support CFRetain
and CFRelease
. That in turn means it's probably OK to cast it to id
and treat it as a NSObject. So you should be simply able to do:
[bContacts addObject:(id)ref];