Memory leak when declaring NSString from ABRecordCopyValue

Posted by Ben Thompson on Stack Overflow See other posts from Stack Overflow or by Ben Thompson
Published on 2012-04-15T13:59:33Z Indexed on 2012/04/16 5:28 UTC
Read the original article Hit count: 264

I am using the following line of code...

NSString *clientFirstName = (NSString *)ABRecordCopyValue(person, kABPersonFirstNameProperty);

The 'analyse' feature on Xcode is saying that this giving rise to a potential memory leak. I am not releasing clientFirstName at all as I have neither alloc or retain'd it.

However, I am conscious that ABRecordCopyValue may not be returning an object as say a command like [NSMutableArray arrayWithArray:someArray] would which might mean I am indeed creating a new object that I control and must release.

Keen to hear thoughts...

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c