abrecordcopyvalue

Swift (iOS 8 SDK) Convert Unmanaged<ABMultiValueRef> to ABMultiValueRef

泄露秘密 提交于 2019-12-29 18:48:34
问题 I need to convert the return value of this function from the AddressBook framework: ABRecordCopyValue(nil, kABPersonPhoneProperty) to a value of type ABMultiValueRef This function is currently marked as this: func ABRecordCopyValue(record: ABRecordRef!, property: ABPropertyID) -> Unmanaged<AnyObject>! So I can convert it to Unmanaged like so: ABRecordCopyValue(person, kABPersonPhoneProperty) as Unmanaged<ABMultiValueRef> But then how can I get it as an ABMultiValueRef so that I can pass it to

AddressBook: Differentiating sources of type kABSourceTypeExchangeGAL

℡╲_俬逩灬. 提交于 2019-12-06 00:53:45
The question I'm asking have already been asked a number of times on this site (links to the previous threads are below my question). When working with iOS AddressBook, and trying to get Exchange GAL address book, the type name returns Nil. The code that I use (and suggested in all previous threads) is: CFStringRef sourceName = (CFStringRef)ABRecordCopyValue(source, kABSourceNameProperty); This basically means that if there are more than one Exchange address book mapped on the device (and there is no limitation to do so...), then there is no way to know which one is the one you need. The

Swift (iOS 8 SDK) Convert Unmanaged<ABMultiValueRef> to ABMultiValueRef

依然范特西╮ 提交于 2019-11-30 00:30:56
I need to convert the return value of this function from the AddressBook framework: ABRecordCopyValue(nil, kABPersonPhoneProperty) to a value of type ABMultiValueRef This function is currently marked as this: func ABRecordCopyValue(record: ABRecordRef!, property: ABPropertyID) -> Unmanaged<AnyObject>! So I can convert it to Unmanaged like so: ABRecordCopyValue(person, kABPersonPhoneProperty) as Unmanaged<ABMultiValueRef> But then how can I get it as an ABMultiValueRef so that I can pass it to this function? func ABMultiValueGetIndexForIdentifier(multiValue: ABMultiValueRef!, identifier:

Swift - Checking unmanaged address book single value property for nil

拈花ヽ惹草 提交于 2019-11-26 22:25:32
问题 I'm relative new to iOS-Development and swift. But up to this point I was always able to help myself by some research on stackoverflow and several documentations and tutorials. However, there is a problem I couldn't find any solution yet. I want to get some data from the users addressbook (for example the single value property kABPersonFirstNameProperty ). Because the .takeRetainedValue() function throws an error if this contact doesn't have a firstName value in the addressbook, I need to