问题
Does anyone know how to setup an IP address in iOs programmatically? It is really easy to do manually, just go to settings and configure the network. However, I want to do this inside a program, to connect to a WiFi network that do not have a DHCP server. Any pointers would help.
Update: This does not seem to be possible. Any suggestion on what I should do instead? The app needs to connect to a network that does not have a DHCP server.
回答1:
I very much suspect this isn't possible without the use of private APIs, as otherwise it would be possible for a malicious app to effectively "break" the user's network settings.
回答2:
You can't do it within the Apple guidelines. It's probably a private API call. If you're talking about an app for jailbroken stuff, it might be a different store.
来源:https://stackoverflow.com/questions/5693126/iphone-sdk-set-static-ip