【问题标题】:How to use NSStreamNetworkServiceTypeBackground on iOS?如何在 iOS 上使用 NSStreamNetworkServiceTypeBackground?
【发布时间】:2012-12-18 08:51:36
【问题描述】:

我在文件 NSStream.h 文件中找到了密钥 NSStreamNetworkServiceTypeBackground。它被声明为

FOUNDATION_EXPORT NSString * const NSStreamNetworkServiceTypeBackground     NS_AVAILABLE(10_7, 5_0);

这意味着,它在 iOS 5 及更高版本中可用。 但是,在 plist 中,我找不到为此设置的匹配背景模式。 有人知道如何使用它吗?

该应用将发布到应用商店,因此需要一种经过批准的方式。

BR, 阿克谢·沙阿。

【问题讨论】:

  • 你有没有发现更多关于这个键的信息?
  • 不..还没有找到任何东西..

标签: iphone ios networking background


【解决方案1】:

如果您使用 CFStream 进行联网,您可以这样做:

NSInputStream *inputStream = (__bridge_transfer NSInputStream *)readStream;
NSOutputStream *outputStream = (__bridge_transfer NSOutputStream *)writeStream;

之后,您可以使用常量(虽然不确定 appstore)

What does setting NSStreamNetworkServiceTypeBackground "do under the hood"?

【讨论】:

  • 大卫,也许我遗漏了一些东西,但这似乎无关紧要,也没有回答关于 NSStreamNetworkServiceTypeBackground 是什么的问题。需要解释一下吗?
猜你喜欢
  • 1970-01-01
  • 2017-11-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-12-05
  • 2014-10-24
  • 1970-01-01
  • 2019-12-06
相关资源
最近更新 更多