设置ABUnknownPersonViewController的人的图像泄漏,我该如何解决这个问题?

时间:2011-01-23 22:57:19

标签: iphone ios abaddressbook

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

我需要在没有泄漏的情况下设置图像。有谁知道怎么做?

1 个答案:

答案 0 :(得分:0)

你在4.2吗? ABPersonSetImageData似乎正在泄漏。试试早期iOS上的代码。