使用Objective-C时,我们通常使用以下代码来获取详细信息
Nsstring *firstName = (__bridge_transfer Nsstring *)ABRecordcopyValue(contactPerson,kABPersonFirstNameProperty);
在Swift中我尝试了以下内容
var firstName : Nsstring = ABRecordcopyValue(contactPerson,kABPersonFirstNameProperty).takeUnretainedValue() as Nsstring
而且由于错误,我无法构建
Bitcast requires both operands to be pointer or neither %224 = bitcast %objc_object* %223 to %PSs9AnyObject_,!dbg !486 Bitcast requires both operands to be pointer or neither %225 = bitcast %PSs9AnyObject_ %224 to i8*,!dbg !486 LLVM ERROR: broken function found,compilation aborted! Command /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift Failed with exit code 1
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。