需要 CoreTelephony 框架示例

发布于 2024-08-28 12:53:14 字数 835 浏览 9 评论 0原文

大家好。

谁能提供一个 CoreTelephony 框架的工作示例吗?我使用 class-dump 转储了所有 CoreTelephony 标头,并将它们添加到“/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk/System/Library/PrivateFrameworks/CoreTelephony.framework”。现在我正在关注 Erica 的教程 (http://blogs.oreilly .com/iphone/2008/08/iphone-notifications.html)。

我在 main.m 中添加了以下代码行,

  id ct = CTTelephonyCenterGetDefault();
  CTTelephonyCenterAddObserver(
        ct, 
        NULL, 
        callback,
        NULL,
        NULL,
        CFNotificationSuspensionBehaviorHold);

但收到​​类似警告,

函数“CTTelephonyCenterGetDefault()”和“CTTelephonyCenterAddObserver(...)”的隐式声明。

有一个完整的工作示例,它将解释如何获取 CoreTelepony 通知?

Greetings everyone.

Can any one has a working example for the CoreTelephony framework? I dumped all the CoreTelephony headers using class-dump and added them to "/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk/System/Library/PrivateFrameworks/CoreTelephony.framework". Now I'm following the Erica's tutorial (http://blogs.oreilly.com/iphone/2008/08/iphone-notifications.html).

I added these following lines of code in my main.m,

  id ct = CTTelephonyCenterGetDefault();
  CTTelephonyCenterAddObserver(
        ct, 
        NULL, 
        callback,
        NULL,
        NULL,
        CFNotificationSuspensionBehaviorHold);

but I'm getting a warning like,

Implicit declaration of function "CTTelephonyCenterGetDefault()" and "CTTelephonyCenterAddObserver(...)".

Can any one has full working example, which will explain how to get the CoreTelepony notifications?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

稳稳的幸福 2024-09-04 12:53:15

我确实设法让这个框架部分工作 - 我仍然有一些功能,我不知道它们确切的 API - 是否有该框架中所有功能的完整描述?

I Did managed to get this framework to work partially - i still have some functions that i don't know their exact API - is there somewhere a full description of all the functions in this framework?

固执像三岁 2024-09-04 12:53:15

警告“函数的隐式声明”意味着编译器无法在标头中找到该函数的定义。

如果函数是在标头中定义的,那么您很可能没有正确导入它们。

我还要指出的是,您不应该在 iPhone 应用程序的 main.m 中放置任何代码。大多数重要代码在 UIApplication 启动之前不会加载。将代码放入应用程序委托的 applicationDidFinishLaunching: 中。

The warning "Implicit declaration of function" means that the compiler cannot find a definition for the function in the header.

If the functions are defined in the header then you most likely did not import them correctly.

I would also note that you should not put any code in the main.m of an iPhone app. Most of the important code does not load until UIApplication is launched. Put the code in the application delegate's applicationDidFinishLaunching: instead.

|煩躁 2024-09-04 12:53:15

甚至使用 http://www.alexwhittemore.com/?p=281 - 打开工具3.0 sdk 链(我找到的最后一个工具链) - 我无法让 CoreTelephony 工作 - 所以在最后一个 Xcode/SDK 中这是不可能的

even using http://www.alexwhittemore.com/?p=281 - Open Tool Chain for 3.0 sdk (last tool chain i'd found) - i couldn't have CoreTelephony working - so it's seams to be impossible in last Xcode's/SDK's

韵柒 2024-09-04 12:53:15

您可以在此处找到 coretelephonyframework 示例!

You can find the coretelephonyframework example here!

近箐 2024-09-04 12:53:14

我已经成功地使用了这个私有框架。这些警告不会阻止您的代码运行,但您可以在代码中添加以下声明来消除 CTTelephoneCenterGetDefault() 上的警告:(

id CTTelephonyCenterGetDefault();

您可以执行以下操作如果您愿意,与 CTTelephonyCenterAddObserver() 警告类似)

I have been successfully using this private framework. The warnings will not prevent your code from running, but you could put the following declaration in your code to get rid of the warning on CTTelephoneCenterGetDefault():

id CTTelephonyCenterGetDefault();

(you can do something similar for the CTTelephonyCenterAddObserver() warning, if you like)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文