Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't Access Contacts Sources on Device in iOS 6
    primarykey
    data
    text
    <p>This code worked OK on iOS 5.1 and also does work in the iPhone simulator with iOS 6. It fails silently on my iPhone 4 running iOS 6. The end result is that I cannot add a person to the Contacts app. Neither of the following code snippets work (log follows each):</p> <pre><code>ABRecordRef defaultSource = ABAddressBookCopyDefaultSource(_addressBook); NSLog(@"2 - defaultSource = %@", defaultSource); </code></pre> <p>AB: Could not compile statement for query (ABCCopyArrayOfAllInstancesOfClassInSourceMatchingProperties): SELECT ROWID, Name, ExternalIdentifier, Type, ConstraintsPath, ExternalModificationTag, ExternalSyncTag, AccountID, Enabled, SyncData, MeIdentifier, Capabilities FROM ABStore WHERE Enabled = ?;</p> <p>2012-09-24 11:00:36.731 QR vCard[193:907] 2 - defaultSource = (CPRecord: 0x1f59fd50 ABStore)</p> <p>When I try to add a person to the Address Book I get this (seems to be because the source is invalid, even though it looks like it might be OK from the above):</p> <p>2012-09-24 11:18:32.231 QR vCard[220:907] ABAddressBookAddRecord error = The operation couldn’t be completed. (ABAddressBookErrorDomain error 1.)</p> <hr> <p>I thought I could get all the sources and then pick one, but the following returns none at all:</p> <pre><code>CFArrayRef allSources = ABAddressBookCopyArrayOfAllSources (_addressBook); NSLog(@"2 - allSources = %@", allSources); </code></pre> <p>AB: Could not compile statement for query (ABCCopyArrayOfAllInstancesOfClassInSourceMatchingProperties): SELECT ROWID, Name, ExternalIdentifier, Type, ConstraintsPath, ExternalModificationTag, ExternalSyncTag, AccountID, Enabled, SyncData, MeIdentifier, Capabilities FROM ABStore WHERE Enabled = ?;</p> <p>2012-09-24 10:58:09.908 QR vCard[177:907] 2 - allSources = ()</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload