iPhone Bonjour From Background
I'm developing an iPhone app t开发者_如何学JAVAhat uses Bonjour Services, and I have the following question:
When the app is sent to background, I need to close my Bonjour service; when the app comes to foreground, how do I restart my Bonjour service?
Thanks
You should be able to make use of the UIApplicationDelegate methods. Specifically, I would take a look at applicationDidBecomeActive: and applicationDidEnterBackground:. When it becomes active, start Bonjour; when it enters background, stop it.
精彩评论