Reputation: 2406
When I'm trying to store phone number of my new contact, in first step below
let multiPhone : ABMutableMultiValueRef = ABMultiValueCreateMutable(kABMultiStringPropertyType)
gives
'int' is not convertible to 'ABPropertyType'
may be as,
func ABMultiValueCreateMutable(type: ABPropertyType) -> Unmanaged<ABMutableMultiValueRef>!
accepts ABPropertyType which is declared as typealias ABPropertyType = UInt32
but,
var kABMultiStringPropertyType: Int { get }
returns Int not UInt32.
Any workaround for this?
Upvotes: 2
Views: 696
Reputation: 86
func createMultiStringRef() -> ABMutableMultiValueRef {
let propertyType: NSNumber = kABMultiStringPropertyType
return Unmanaged.fromOpaque(ABMultiValueCreateMutable(propertyType.unsignedIntValue).toOpaque()).takeUnretainedValue() as NSObject as ABMultiValueRef
}
Upvotes: 7