iOS 来电显示检索
我正在尝试使用以下代码获取来电号码(对于越狱设备): extern CFTypeRef CTCallCopyName(void*, CTCall* 调用);
NSLog(@"%@", CTCallCopyName(NULL, (CTCall*)call));
我收到错误: “CTCallCopyName(void*, CTCall*)”,引用自: ld:未找到架构armv6的符号
我有与我的项目链接的Core Telephony。 也许我的原型是错误的......我不知道。有什么想法吗? Xcode 3、SDK 4
I'm trying to get the caller number (for jailbroken devices) with this code:
extern CFTypeRef CTCallCopyName(void*, CTCall* call);
NSLog(@"%@", CTCallCopyName(NULL, (CTCall*)call));
I receive the error:
"CTCallCopyName(void*, CTCall*)", referenced from:
ld: symbol(s) not found for architecture armv6
I have Core Telephony linked with my project.
Maybe my prototype is wrong... i don't know. Any ideas?
Xcode 3, sdk 4
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您在 .mm 文件中调用此 API,则必须将其声明为 extern "C" void foo(void);据我所知,在 iOS 5 ~ 7 上,你应该使用 CTCallCopyAddress 代替,原型是:
注意第二个参数是 CTCallRef 而不是 CTCall,这意味着你不能向它发送 CTCall 类方法(尽管其中一些方法可以工作)。除了链接 CoreTelephony.framework 之外,您还可以动态加载此符号,如下所示:
顺便说一句,我无法让 CTCallCopyName 在 iOS 5 上的 SpringBoard 中工作,还没有弄清楚或在其他系统上尝试过。希望这些信息有帮助!
编辑:在 iOS 5 上再试一次,CTCallGetID 是获取地址簿中来电显示的正确函数,其原型为 ABRecordID CTCallGetID(CTCallRef)。 iOS 6 和 7 可能是相同的。
If you're calling this API in a .mm file, you have to declare it like extern "C" void foo(void); As far as I know, on iOS 5 ~ 7, you should use CTCallCopyAddress instead, the prototype is:
Notice that the second arg is a CTCallRef rather than a CTCall, which means you can't send it CTCall class methods (although some of them work). Besides linking CoreTelephony.framework, you can also load this symbol dynamically, as shown below:
BTW, I can't get CTCallCopyName to work in SpringBoard on iOS 5, haven't figured it out or tried on other systems yet. Hope this information helps!
EDIT: Just give it another try on iOS 5, CTCallGetID is the right function to get the caller ID in the addressbook, whose prototype is ABRecordID CTCallGetID(CTCallRef). iOS 6 and 7 are possibly the same.