3

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?

4

5 回答 5

3

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

id CTTelephonyCenterGetDefault();

CTTelephonyCenterAddObserver()(如果你愿意,你可以对警告做类似的事情)

于 2010-09-28T14:10:04.533 回答
1

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

于 2011-12-19T20:05:03.513 回答
0

即使使用http://www.alexwhittemore.com/?p=281 - Open Tool Chain for 3.0 sdk(我找到的最后一个工具链) - 我无法让 CoreTelephony 工作 - 所以在最后的 Xcode 中接缝是不可能的/SDK 的

于 2010-08-04T14:38:44.147 回答
0

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

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

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

于 2010-04-12T17:29:30.940 回答
0

您可以在此处找到核心电话框架示例!

于 2012-08-23T10:17:32.663 回答