Has anyone had issues with this code…
ABRecordRef person = ABAddressBookGetPersonWithRecordID (addressBook,recordID);
I have had major issues with this so far. I have previously posted this question Intermittent error accessing core data model / contacts database
However, I have now tracked it down to this method returning a NULL value despite there being legitimate addressBook and recordID values.
Any idea of why this might be happening?
Many thanks
Posting answer in case it helps others…
It turns out the issue was memory related. I have created an addressBook with: ABAddressBookCreate(). This was happening inside a loop so was being created over and over again. The solution was to move the creation outside of the loop and balance with CFRelease(addressBook); command.
Hope this helps others!!