iphone - Memory still increasing when use CFRelease for ABRecordCopyValue? -
i have problem make headache, create method:
-(void) main{ (int = 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 memory approximate constants because have release memory copied, in reality still increasing each loop i; can explain me :(. thanks!
your code wrong. abaddressbookgetpersonwithrecordid call follows core foundation 'get rule'. means not have ownership of return value , not have release it.
Comments
Post a Comment