ABRecordRef thecomicstrip = NULL;
person = ABPersonCreate();
//LEAKS
UIImage *iconImage = [UIImage imageNamed:@"my_icon.png"];
NSData * data = UIImagePNGRepresentation(iconImage);
ABPersonSetImageData(thecomicstrip, (CFDataRef)data, nil);
ABUnknownPersonViewController * unknownPersonViewController = [[ABUnknownPersonViewController alloc] init];
unknownPersonViewController.allowsAddingToAddressBook = NO;
unknownPersonViewController.displayedPerson = person;
[self.navigationController pushViewController:unknownPersonViewController animated:NO];
[unknownPersonViewController release];
CFRelease(person);
我需要在没有泄漏的情况下设置图像。有谁知道怎么做?
答案 0 :(得分:0)
你在4.2吗? ABPersonSetImageData似乎正在泄漏。试试早期iOS上的代码。