Can iPhone App access the Notes field in the Contact Book (assuming user allows access to contacts)

StackOverflow https://stackoverflow.com/questions/23415806

  •  13-07-2023
  •  | 
  •  

Question

Can an iPhone App access the notes field in the Contact Book? I am assuming that the user has permitted the app to allow access to "Contacts" when prompted.

Can all available fields in Contacts be accessed?

Was it helpful?

Solution

Yes, you get the note value like you would for the other properties. For example, you can use ABRecordCopyValue with the kABPersonNoteProperty. See the Address Book Programming Guide for iOS, notably the Direct Interaction: Programmatically Accessing the Database chapter.

For example, to get the last name, you would:

NSString *name = CFBridgingRelease(ABRecordCopyValue(person, kABPersonLastNameProperty));

To get the note, you would:

NSString *note = CFBridgingRelease(ABRecordCopyValue(person, kABPersonNoteProperty));

See the Constants section of the ABPerson Reference for a list of the properties that can be retrieved.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top