PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, October 21, 2022

[FIXED] How do I get access to the externalIdentifier of a CNContainer object in iOS using Swift with Xcode?

 October 21, 2022     cncontainer, contacts, ios, swift, xcode     No comments   

Issue

How do I get access to the externalIdentifier of a CNContainer object?

externalIdentifier is not an instance property of the CNContainer object. I printed to the debug window the description property of a CNContainer object. I show that below, with "externalIdentifier" in bold.

<CNContainer: 0x2829a43f0: identifier=32B14F4B-7299-4AA5-BADD-85344DB3D7B8, name=Contacts, type=3 ( CardDAV ), iOSLegacyIdentifier=1346, accountIdentifier=012AF8C6-A3AB-4AD6-8C91-5FB5266CC8E6, enabled=1, permissions=<CNContainerPermissions: 0x2819a21e0: canCreateContacts=NO, canDeleteContacts=NO, canCreateGroups=NO>, externalIdentifier=/dav/brenebrownfan/Contacts/, externalModificationTag=c7e1249ffc03eb9ded908c236bd1996d, externalSyncTag=(nil), externalSyncData={length = 95, bytes = 0x62706c69 73743030 d2010203 045e6d61 ... 00000000 0000003a }, constraintsPath=(nil), meIdentifier=635, restrictions=0, guardianRestricted=0, lastSyncDate=2019-09-25 08:14:59 +0000>


Solution

Swift:

let externalIdentifier = container.value(forKey: "externalIdentifier") as? String

Objective-C:

NSString *externalIdentifier = [container valueForKey:@"externalIdentifier"];



Answered By - Thomas Verbeek
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing