Kodeco Forums

Address Book Tutorial in iOS

In this Address Book Tutorial in iOS, learn how to add and edit contacts in a fun app about pets.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/2451-address-book-tutorial-in-ios

The current version of this will crash on the line

if(CFStringCompare(ABRecordCopyCompositeName(thisContact),
ABRecordCopyCompositeName(pet), 0) == kCFCompareEqualTo){

if the user has any contacts in their address book without a name. To fix this, first check if ABRecordCopyCompositeName(thisContact) is not nil before making the comparison.

Another issue is that the Core Foundation objects need to be released manually with CFRelease even with ARC enabled. An analyze build of the project will point out all the Core Foundation objects that are leaking memory.

This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]