小编Jeg*_*gus的帖子

以编程方式强制iOS 7应用程序暂停?

我试图强制我的应用程序以编程方式自动进入"暂停"状态,因此我可以对Core Bluetooth恢复进行测试.我试过打电话

[[UIApplication sharedApplication] performSelector:@selector(suspend)];
Run Code Online (Sandbox Code Playgroud)

但这只是将它发送到后台.我做错了吗?有没有更好的办法?还是不可能?

我想提醒大家确切地说暂停应用程序意味着什么,因为术语总是存在混淆: 链接到iPhone应用程序的状态图 如果系统需要内存,后台的应用程序将无限期暂停,但Core Bluetooth的恢复可以暂时将应用程序发送回后台状态.

ios

8
推荐指数
1
解决办法
2405
查看次数

适用于iOS 7的核心蓝牙弃用

在iOS 7中,一些核心蓝牙的东西现在已被弃用,如CBUUIDGenericAccessProfileString和CBUUIDDeviceNameString.在苹果文档状态

"(Deprecated. There are no replacements for these constants.)"
Run Code Online (Sandbox Code Playgroud)

我想知道我们应该做些什么来取代这些GAP的东西,因为苹果文档和例子没有任何帮助.整个互联网似乎也对此保持沉默.我的代码就像心率监测器示例一样,它仍然有不推荐的代码

/* GAP (Generic Access Profile) for Device Name */
if ( [aService.UUID isEqual:[CBUUID UUIDWithString:CBUUIDGenericAccessProfileString]] )
{
    [aPeripheral discoverCharacteristics:nil forService:aService];
}
Run Code Online (Sandbox Code Playgroud)

core-bluetooth ios7

3
推荐指数
1
解决办法
1467
查看次数

标签 统计

core-bluetooth ×1

ios ×1

ios7 ×1