Platforms to show: All Mac Windows Linux Cross-Platform
CNContactMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Contacts | MBS Mac64bit Plugin | 16.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
The CNContact is a thread-safe class that represents an immutable value object for contact properties, such as the first name and phone numbers of a contact. CNContact is similar to a complex Foundation collection, in that it has a mutable subclass (CNMutableContact). Neither the CNContact nor CNMutableContact class maintain a reference to their data store. Every contact has a unique ID, which you obtain using the identifier property.
This is an abstract class. You can't create an instance, but you can get one from various plugin functions.
- 23 properties
- property birthday as NSDateComponentsMBS
- property contactType as Integer
- property departmentName as String
- property familyName as String
- property givenName as String
- property Handle as Integer
- property identifier as String
- property imageData as MemoryBlock
- property imageDataAvailable as Boolean
- property jobTitle as String
- property middleName as String
- property namePrefix as String
- property nameSuffix as String
- property nickname as String
- property nonGregorianBirthday as NSDateComponentsMBS
- property note as String
- property organizationName as String
- property phoneticFamilyName as String
- property phoneticGivenName as String
- property phoneticMiddleName as String
- property phoneticOrganizationName as String
- property previousFamilyName as String
- property thumbnailImageData as MemoryBlock
- 15 methods
- method areKeysAvailable(keyDescriptors() as CNKeyDescriptorMBS) as Boolean
- method Constructor Private
- method contactRelations as CNLabeledValueMBS()
- method copy as CNContactMBS
- method dates as CNLabeledValueMBS()
- method emailAddresses as CNLabeledValueMBS()
- method instantMessageAddresses as CNLabeledValueMBS()
- method isKeyAvailable(key as String) as Boolean
- method isUnifiedWithContactWithIdentifier(contactIdentifier as String) as Boolean
- method mutableCopy as CNMutableContactMBS
- method phoneNumbers as CNLabeledValueMBS()
- method postalAddresses as CNLabeledValueMBS()
- method socialProfiles as CNLabeledValueMBS()
- method urlAddresses as CNLabeledValueMBS()
- method valueForKey(key as String) as Variant
- 40 shared methods
- shared method available as Boolean
- shared method CNContactBirthdayKey as String
- shared method CNContactDatesKey as String
- shared method CNContactDepartmentNameKey as String
- shared method CNContactEmailAddressesKey as String
- shared method CNContactFamilyNameKey as String
- shared method CNContactGivenNameKey as String
- shared method CNContactIdentifierKey as String
- shared method CNContactImageDataAvailableKey as String
- shared method CNContactImageDataKey as String
- shared method CNContactInstantMessageAddressesKey as String
- shared method CNContactJobTitleKey as String
- shared method CNContactMiddleNameKey as String
- shared method CNContactNamePrefixKey as String
- shared method CNContactNameSuffixKey as String
- shared method CNContactNicknameKey as String
- shared method CNContactNonGregorianBirthdayKey as String
- shared method CNContactNoteKey as String
- shared method CNContactOrganizationNameKey as String
- shared method CNContactPhoneNumbersKey as String
- shared method CNContactPhoneticFamilyNameKey as String
- shared method CNContactPhoneticGivenNameKey as String
- shared method CNContactPhoneticMiddleNameKey as String
- shared method CNContactPhoneticOrganizationNameKey as String
- shared method CNContactPostalAddressesKey as String
- shared method CNContactPreviousFamilyNameKey as String
- shared method CNContactPropertyNotFetchedExceptionName as String
- shared method CNContactRelationsKey as String
- shared method CNContactSocialProfilesKey as String
- shared method CNContactThumbnailImageDataKey as String
- shared method CNContactTypeKey as String
- shared method CNContactUrlAddressesKey as String
- shared method descriptorForAllComparatorKeys as CNKeyDescriptorMBS
- shared method localizedStringForKey(key as String) as String
- shared method predicateForContactsInContainerWithIdentifier(containerIdentifier as String) as NSPredicateMBS
- shared method predicateForContactsInGroupWithIdentifier(groupIdentifier as String) as NSPredicateMBS
- shared method predicateForContactsMatchingEmailAddress(emailAddress as String) as NSPredicateMBS
- shared method predicateForContactsMatchingName(name as String) as NSPredicateMBS
- shared method predicateForContactsMatchingPhoneNumber(phoneNumber as CNPhoneNumberMBS) as NSPredicateMBS
- shared method predicateForContactsWithIdentifiers(Identifiers() as String) as NSPredicateMBS
- 6 constants
Sort Orders
Constant | Value | Description |
---|---|---|
CNContactSortOrderFamilyName | 3 |
Order by Family Name. |
CNContactSortOrderGivenName | 2 |
Order by Given Name. |
CNContactSortOrderNone | 0 |
Order by no order. |
CNContactSortOrderUserDefault | 1 |
Order by user preference. |
Contact Types
Constant | Value | Description |
---|---|---|
CNContactTypeOrganization | 1 |
The contact is an Organization. |
CNContactTypePerson | 0 |
The contact is a person. |
Sub classes:
Some methods using this class:
- CNContactFormatterMBS.attributedStringFromContact(contact as CNContactMBS, DefaultAttributes as Dictionary = nil) as NSAttributedStringMBS
- CNContactFormatterMBS.attributedStringFromContact(contact as CNContactMBS, Style as Integer, DefaultAttributes as Dictionary = nil) as NSAttributedStringMBS
- CNContactFormatterMBS.delimiterForContact(contact as CNContactMBS) as String
- CNContactStoreMBS.allContacts(byref error as NSErrorMBS) as CNContactMBS()
- CNContactStoreMBS.ContactsWithFetchRequest(fetchRequest as CNContactFetchRequestMBS, byref error as NSErrorMBS) as CNContactMBS()
- CNContactStoreMBS.unifiedContactsMatchingPredicate(predicate as NSPredicateMBS, keysToFetch() as CNKeyDescriptorMBS, byref error as NSErrorMBS) as CNContactMBS()
- CNContactStoreMBS.unifiedContactWithIdentifier(identifier as string, byref error as NSErrorMBS) as CNContactMBS
- CNContactVCardSerializationMBS.contactsWithData(Data as MemoryBlock, byref error as NSErrorMBS) as CNContactMBS()
- CNContactVCardSerializationMBS.dataWithContacts(Contacts() as CNContactMBS, byref error as NSErrorMBS) as MemoryBlock
- CNSaveRequestMBS.removeMember(contact as CNContactMBS, group as CNGroupMBS)
Some properties using for this class:
- CNChangeHistoryAddContactEventMBS.contact as CNContactMBS
- CNChangeHistoryAddMemberToGroupEventMBS.member as CNContactMBS
- CNChangeHistoryRemoveMemberFromGroupEventMBS.member as CNContactMBS
- CNChangeHistoryUpdateContactEventMBS.contact as CNContactMBS
- CNContactPropertyMBS.Contact as CNContactMBS
- CNContactViewControllerMBS.Contact as CNContactMBS
Some events using this class:
- CNContactPickerMBS.didSelectContact(contact as CNContactMBS)
- CNContactPickerViewControllerMBS.didSelectContact(contact as CNContactMBS)
- CNContactPickerViewControllerMBS.didSelectContacts(contacts() as CNContactMBS)
- CNContactStoreMBS.enumerateContactsWithFetchRequest(contact as CNContactMBS, byref stop as boolean, tag as Variant)
Some examples using this class:
- /Mac64bit/Contacts/CNContactPicker Test
- /Mac64bit/Contacts/CNContactPickerViewController Test
- /Mac64bit/Contacts/Contacts Display Person
- /Mac64bit/Contacts/Contacts History
- /Mac64bit/Contacts/Contacts Test
Blog Entries
- CNContactPickerViewController for Xojo
- Contacts history for Xojo
- News from the MBS Xojo Plugins Version 20.5
- MBS Xojo Plugins, version 20.5pr1
- MBS Xojo Plugins, version 18.1pr2
- MBS Xojo Plugins, version 17.2pr5
Release notes
- Version 20.5
- Added phoneticOrganizationName property for CNContactMBS class and phoneticOrganizationName property for CNMutableContactMBS class.
- Added predicateForContactsMatchingEmailAddress and predicateForContactsMatchingPhoneNumber methods for CNContactMBS class.
- Version 18.1
- Fixed problems with CNContactMBS phoneNumbers and others having wrong return type.
- Version 17.2
- Added valueForKey methods to CNContactMBS and CNGroupMBS classes.
The items on this page are in the following plugins: MBS Mac64bit Plugin.
CNContactFormatterMBS - CNContactPickerMBS