当我试图存储我的新联系人的电话号码时,在下面的第一步
let multiPhone : ABMutableMultiValueRef = ABMultiValueCreateMutable(kABMultiStringPropertyType)给出
'int' is not convertible to 'ABPropertyType'可能是,
func ABMultiValueCreateMutable(type: ABPropertyType) -> Unmanaged<ABMutableMultiValueRef>!接受声明为ABPropertyType的typealias ABPropertyType = UInt32,但是
var kABMultiStringPropertyType: Int { get }返回Int而不是UInt32。
有什么解决办法吗?
发布于 2014-08-08 14:11:28
func createMultiStringRef() -> ABMutableMultiValueRef {
let propertyType: NSNumber = kABMultiStringPropertyType
return Unmanaged.fromOpaque(ABMultiValueCreateMutable(propertyType.unsignedIntValue).toOpaque()).takeUnretainedValue() as NSObject as ABMultiValueRef
}https://stackoverflow.com/questions/25204115
复制相似问题