M.B Kakadiya
M.B Kakadiya

Reputation: 576

How to fix Xcode analyze issue

How to fixed iOS analyze issues like "Potential leak of an object stored into" enter image description here

CODE

ABMultiValueRef email = ABRecordCopyValue(person, kABPersonEmailProperty);
txtEmail.text = ( NSString*)CFBridgingRelease(ABMultiValueCopyValueAtIndex(email, 0));


ABMultiValueRef multi = ABRecordCopyValue(person, kABPersonPhoneProperty);
txtTelel.text = ( NSString*)CFBridgingRelease(ABMultiValueCopyValueAtIndex(multi, 0));

Upvotes: 1

Views: 90

Answers (1)

Sviatoslav Yakymiv
Sviatoslav Yakymiv

Reputation: 7935

Try this:

ABMultiValueRef email = ABRecordCopyValue(person, kABPersonEmailProperty);
txtEmail.text = ( NSString*)CFBridgingRelease(ABMultiValueCopyValueAtIndex(email, 0));
CFRelease(email);


ABMultiValueRef multi = ABRecordCopyValue(person, kABPersonPhoneProperty);
txtTelel.text = ( NSString*)CFBridgingRelease(ABMultiValueCopyValueAtIndex(multi, 0));
CFRelease(multi);

Upvotes: 1

Related Questions