如何修复Xcode分析问题

时间:2014-07-24 16:23:23

标签: ios objective-c xcode

如何修复iOS分析问题,例如"存储在"中的对象的潜在泄漏。 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));

1 个答案:

答案 0 :(得分:1)

试试这个:

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);