简体   繁体   English

从背景的iPhone Bonjour

[英]iPhone Bonjour From Background

I'm developing an iPhone app that uses Bonjour Services, and I have the following question: 我正在开发一个使用Bonjour服务的iPhone应用程序,我有以下问题:

When the app is sent to background, I need to close my Bonjour service; 当应用程序发送到后台时,我需要关闭我的Bonjour服务; when the app comes to foreground, how do I restart my Bonjour service? 当应用程序到达前台时,如何重新启动我的Bonjour服务?

Thanks 谢谢

You should be able to make use of the UIApplicationDelegate methods. 您应该能够使用UIApplicationDelegate方法。 Specifically, I would take a look at applicationDidBecomeActive: and applicationDidEnterBackground: . 具体来说,我将看一下applicationDidBecomeActive:applicationDidEnterBackground : . When it becomes active, start Bonjour; 当它变得活跃时,启动Bonjour; when it enters background, stop it. 当它进入背景时,停止它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM