The analyzer doesn't understand you wish to assign a retained address book in your property, and thus not release it at the end of doSomethingInteresting
.
Change your property to:
@property (strong, nonatomic) id addressBook;
and set it like so:
[self setAddressBook:CFBridgingRelease(addressBook)];
Now, when you want to use the addressBook
property, use the (__bridge ABAddressBookRef)
cast.
Also, you need to release a potential CFErrorRef
object, which may have been created during ABAddressBookCreateWithOptions
:
if(error)
{
CFRelease(error);
error = NULL;
}