मैं AddressBook ढांचे के आसपास काम कर रहा था जब मैं बाहर विभिन्न प्रकार के कुछ स्मृति रिसाव अपने आवेदन में मिल गया है:आईओएस - मेमोरी रिसाव AddressBook
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person {
SDAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
ABMultiValueRef multiRef = ABRecordCopyValue(person, kABPersonPhoneProperty);
NSString *number = (__bridge NSString *) ABMultiValueCopyValueAtIndex(multiRef, 0);
NSString *firstname = (__bridge NSString *)ABRecordCopyValue(person, kABPersonFirstNameProperty);
NSString *lastname = (__bridge NSString *)ABRecordCopyValue(person, kABPersonLastNameProperty);
number = (number ? number : @"");
firstname = (firstname ? firstname : @"");
lastname = (lastname ? lastname : @"");
NSDictionary *dic = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:number, firstname, lastname, nil] forKeys:[NSArray arrayWithObjects:kSDPhoneNumberKey, kSDFirstnameKey, kSDLastnameKey, nil]];
NSMutableArray *numberArray = [NSMutableArray arrayWithArray:appDelegate.contactArray];
[numberArray addObject:dic];
[appDelegate setContactArray:numberArray];
[self.tableView reloadData];
[self dismissModalViewControllerAnimated:YES];
return NO;
}
कोई कार्य करें:
Leaked Object # Address Size Responsible Library Responsible Frame
__NSCFArray 8 <multiple> 256 Bytes AddressBook ABCMultiValueInsertAndCreateIdentifier
__NSCFString 7 <multiple> 224 Bytes AppSupport _sqliteStatementApplyValuesFromRecordWithNullValue
Malloc 32 Bytes 8 <multiple> 256 Bytes AddressBook ABCMultiValueInsertAndCreateIdentifier
__NSCFArray 8 <multiple> 256 Bytes AddressBook ABCMultiValueInsertAndCreateIdentifier
ABCMultiValue 8 <multiple> 256 Bytes AddressBook ABCMultiValueCreate
Malloc 32 Bytes 7 <multiple> 224 Bytes AddressBook ABCMultiValueInsertAndCreateIdentifier
__NSCFArray 7 <multiple> 224 Bytes AddressBook ABCMultiValueInsertAndCreateIdentifier
Malloc 32 Bytes 5 <multiple> 160 Bytes AddressBook ABCMultiValueInsertAndCreateIdentifier
यहाँ मेरी कोड है पता है कि इन लीक के लिए कौन सी लाइनें जिम्मेदार हैं?
वाह, बहुत बहुत धन्यवाद! कोई और मेमोरी लीक और विश्लेषण उपकरण अद्भुत नहीं है, मुझे नहीं पता था कि यह वहां था! – Yaman