Questions tagged [cncontact]

CNContact is a thread-safe class for Apple architectures (MacOS, iOS, watchOS, etc.) that represent an immutable value object for contact properties, such as the first name and phone numbers of a contact.

The contact class (CNContact) is a thread-safe, immutable value object of contact properties, such as the contact’s name, image, or phone numbers. The contact class is like NSDictionary; it has a mutable subclass CNMutableContact you can use to modify contact properties. For contact properties that can have multiple values, such as phone numbers or email addresses, an array of CNLabeledValue objects is used. The labeled value class is a thread-safe, immutable tuple of labels and values. Labels describe each value to the user, allowing differentiation such as home and work phone numbers. The Contacts framework provides some predefined labels and you can create your own custom labels.

256 questions
0
votes
1 answer

AuthorizationStatus for Contacts not changing when switched on

Im writing an app which is available from iOS 7. And I'm using contacts for retrieving data of the user which is logged in his connection (in the app). I've written some code which checks if the CNAuthorizationStatus status = [CNContactStore…
0
votes
1 answer

CNContact Example of a Fetch and import of a Contact into App

I have been using ABPeople Picker to show Contacts and then import the selected contact into my app. Need to migrate to CNContact as AB has become unreliable. I have found some examples but they're all in Swift. Specifically, need ObjectiveC…
John
  • 538
  • 4
  • 18
0
votes
0 answers

Get duplicate CNContacts from ContactStore?

I'm trying to get duplicate CNContacts in iOS 9 Contacts Framework and I quite can't find a good solution. I have tried to get them and loop trough but it's kinda slow and on older devices it will be slower.. This is the best I have succeeded on…
Silviu St
  • 1,810
  • 3
  • 33
  • 42
0
votes
1 answer

Issue about the newest Contacts ios Framework

I'm working on my app and at a certain point the user can convince their friends to download it. However, the ABAddressBook framework (link) has been deprecated with iOS 9, so I had to teach myself the newest Contacts framework (link). However, I'm…
Lkm
  • 113
  • 11
0
votes
1 answer

How to load all contacts in an array ios9

AddressBook api is deprecated in ios 9. I want to load all contacts in an array and display it in a UITableView. I don't want to use iOS default ContactPicker as I have to do some customization while displaying. How to load all contact list in an…
Rashad
  • 11,057
  • 4
  • 45
  • 73
0
votes
2 answers

This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.

i am loading Contacts using New framework of Apple. -(void)getAllContactsWithNewFrameworkOfApple { NSMutableArray *_contactsArray = [[NSMutableArray alloc]init]; CNAuthorizationStatus status = [CNContactStore…
Sam Shaikh
  • 1,596
  • 6
  • 29
  • 53
0
votes
1 answer

Contact Fetching Issue

We are using CNContactStore to fetch contacts from iphone, but we are getting all contacts from my iphone which is giving all synched contacts like facebook and other gmail contacts too, but i need to fetch only the contacts stored in iphone. how to…
Vetri
  • 25
  • 6
0
votes
1 answer

CNSaveRequest returns "Updated Record Does Not Exist"

The code I'm debugging tries to save a contact to Contacts.app via the new CNContacts framework in iOS 9. However it fails and returns this error. The code isn't updating a record but rather it is trying to create a new one. Why and I getting this…
Steve Moser
  • 7,647
  • 5
  • 55
  • 94
0
votes
1 answer

CNContactPicker grant permission not prompting

I'm updating my app to use CNContacts instead of AB. I've noticed that I am not getting prompted for granting permission to my Contacts. In the below switch, it is correctly telling me I am denied access - but then it doesn't prompt me to give it…
Charlie
  • 1,279
  • 2
  • 12
  • 28
-1
votes
2 answers

Getting CNLabeledValue error "'NSCopying & NSSecureCoding' cannot be in Xcode 10.2 not in Xcode 10.1

var currentContact = CNLabeledValue() I want to create a variable which will store the value from the contact which can be either a phone number or an email address var currentContact = CNLabeledValue
Abhijit_R
  • 13
  • 8
-1
votes
1 answer

Fetching Contacts from mobile and store to sqliteDB using Swift 3

I am new in the Swift 3 language and I want to fetch contacts from the phone in an array and then store in sqliteDB. Please help. I saw an old tutorial of Swift 2.1 but all these methods are deprecated and I tried a lot with CNContacts but this was…
Arslan Javed
  • 83
  • 11
-1
votes
1 answer

Access recent contacts iOS 9

It is possible to access to recent contacts on top of screen in app switcher ? I looked in the documentation but I haven't found any method that allow to do that. Any suggestions would be greatly appreciated! Thanks
HamzaGhazouani
  • 6,464
  • 6
  • 33
  • 40
-1
votes
1 answer

There's a bug in CNContactPickerController

After spending all day (>12 hours) trying to isolate a bug in 13 lines of mind-bogglingly generic code, I have come to the dubious conclusion that there must be a bug in the current iteration of CNContactPickerViewController, in iOS 9.2. Simply…
ray
  • 102
  • 1
  • 8
-2
votes
1 answer

Fetching contact no crashes when there is no phone no assigned to the contact

I am trying to read the contact phone no. The below code works fine if the number is available but if there are no phone no assigned to the contact , it is crashing. Can Anu let me know how to handle…
Warrior
  • 39,156
  • 44
  • 139
  • 214
-2
votes
1 answer

Cannot convert type '[String: Any Object]' to expected type 'String'

Trying to get the phone number string out of CNContacts. I pull up a contact picker view controller and when the user selects multiple contacts, I create a message compose view controller. I need to create an array of strings to pass along as the…
1 2 3
17
18