Releasing Core Foundation object references
Do I need to release a Core Foundation objects to clear up memory? And if so, how? For example, in the code: ABAddressBookRef addressBook = ABAddressBookCreate(); CFArrayRef peopleArray = ABAddressBookCopyArrayOfAllPeople(addressBook); do I need to release peopleArray ? What about addressBook ? Yes, in CoreFoundation you have to release anything with Create or Copy in the name. You do this with CFRelease(). In your case, you should be releasing both the array and the address book references. The rules for memory management in Core Foundation are similar to those in Cocoa: if the method that