0
當我使用儀器時,它抱怨在emailProperty上發生內存泄漏。分析儀抱怨mobileLabel。代碼片段如下。鑑於我使用的版本和CFRelease,它有抱怨的原因有明顯的原因嗎?預先感謝您的回覆。ABMultiValueRef內存泄漏?
// Email is a multi value property, take "Home"
ABMultiValueRef emailProperty = ABRecordCopyValue(person, kABPersonEmailProperty);
NSString *email;
NSString *mobileLabel;
for (CFIndex i = 0; i < ABMultiValueGetCount(emailProperty); i++)
{
mobileLabel = (NSString *)ABMultiValueCopyLabelAtIndex(emailProperty, i);
if ([mobileLabel isEqualToString:@"_$!<Home>!$_"])
{
email = (NSString *)ABMultiValueCopyValueAtIndex(emailProperty,i);
self.emailAddress.text = email;
self.emailAddress.enabled = NO;
self.emailAddress.borderStyle = UITextBorderStyleNone;
[email release];
break;
}
[mobileLabel release];
}
CFRelease(emailProperty);