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.

see core foundation - memory management


Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -