我的项目中有以下代码
- (BOOL)peoplePickerNavigationController:
(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person {
[popContactsForm dismissPopoverAnimated:YES];
[ssemailvc setName: (NSString *)ABRecordCopyValue(person,kABPersonFirstNameProperty)];
ABMultiValueRef emails = (NSString *)ABRecordCopyValue(person,kABPersonEmailProperty);
if (ABMultiValueGetCount(emails)>0) {
[ssemailvc setEmail:(NSString *)ABMultiValueCopyValueAtIndex(emails,0)];
}else [ssemailvc setEmail:@""];
CFRelease(emails);
[peoplePicker dismissModalViewControllerAnimated:YES];
[popEmailForm setPopoverContentSize:CGSizeMake(350.0, 225.0)];
return NO;
}
Run Code Online (Sandbox Code Playgroud)
我收到了警告
1.call to function'ABRecordCopyValue'返回一个corefoundation对象,其中+1保留计数2.object泄露:在执行的后期没有引用已分配的对象,并且保留计数为+1
请告诉我如何克服这个问题