有没有一种方法可以在iOS中以编程方式打开和关闭wifi?

问题描述:

我使用此链接上的代码为蓝牙完成了此操作: 有没有一种方法可以在iOS中以编程方式打开和关闭蓝牙和/或wifi?

I done it for Bluetooth using the code on this link: Is there a way to toggle bluetooth and/or wifi on and off programmatically in iOS?

但是我不知道如何为Wifi做同样的事情.您如何打开/关闭Wifi?有可能吗?

But I couldn't figure out how to do the same for Wifi. How do you switch the Wifi on/off? Is it possible?

在iOs 2.x中,您可以使用一些私有API来执行此操作,但是在iOS4.x,5.x中它不起作用.希望Apple公开用于管理Wifi的API,现在该API仅由Setting apple应用程序使用.

In iOs 2.x you can use some private API to do this, however it does not work in iOS4.x, 5.x. Hope that Apple will public the API for manage Wifi, now it is only used by Setting apple app.