static InitConstants() { // ensure we can init. This is needed before iOS6 (as per doc). IntPtr p = ABAddressBook.ABAddressBookCreate(); ABGroupProperty.Init(); ABLabel.Init(); ABPersonAddressKey.Init(); ABPersonDateLabel.Init(); ABPersonInstantMessageKey.Init(); ABPersonInstantMessageService.Init(); ABPersonKindId.Init(); ABPersonPhoneLabel.Init(); ABPersonPropertyId.Init(); ABPersonRelatedNamesLabel.Init(); ABPersonUrlLabel.Init(); ABSourcePropertyId.Init(); // From iOS 6.0+ this might return NULL, e.g. if the application is not authorized to access the // address book, and we would crash if we tried to release a null pointer if (p != IntPtr.Zero) { CFType.Release(p); } }
static InitConstants() { // ensure we can init. CFObject.CFRelease(ABAddressBook.ABAddressBookCreate()); ABGroupProperty.Init(); ABLabel.Init(); ABPersonAddressKey.Init(); ABPersonDateLabel.Init(); ABPersonInstantMessageKey.Init(); ABPersonInstantMessageService.Init(); ABPersonKindId.Init(); ABPersonPhoneLabel.Init(); ABPersonPropertyId.Init(); ABPersonRelatedNamesLabel.Init(); ABPersonUrlLabel.Init(); }