i have a problem make headache, i simply create method:
-(void) main{
for (int i = 0; i< 100;i++) {
[self getPhoneOfContact:i];
}
}
-(void)getPhoneOfContact:(NSInteger)id_contact {
ABRecordRef record = ABAddressBookGetPersonWithRecordID(addressBook,id_contact);
CFTypeRef ref1;
ref1 = ABRecordCopyValue(record,kABPersonPhoneProperty);
CFRelease(record);
CFRelease(ref1);
}
I think the memory will approximate constants because i have release memory copied, but in reality it still increasing for each loop i; who can explain me this :(. thanks!
Your code is wrong. The ABAddressBookGetPersonWithRecordID call follows the Core Foundation 'Get Rule'. This means you do not have ownership of the return value and thus you do not have to release it.
See Core Foundation - Memory Management
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With