I am using the following code to initialize the address book in my application :-
@property(nonatomic,assign) ABAddressBookRef addressBookRef;
self.addressBookRef=ABAddressBookCreateWithOptions(NULL, NULL);
However, the xcode analyzer is giving me the following message :-
call to function 'ABAddressBookCreateWithOptions' returns a Core Foundation Object with a +1 retain count
Now, as far as I have read, I can "remove" the above warning by the following 2 methods :-
- Release
addressBookRef
by usingCFRelease
- Instead of
self.addressBookRef
, use_addressBookRef
in second statement.
However, which one will be a better way and why ?