I have an application which hits the server for communication. In case, my s开发者_Python百科erver address changes, i want to incorporate that changed address in the application from the device itself.
I dont want to build my application again and sync it with itunes and then with my device. As an administrator, i want to update the url from outside.
I would suggest using NSUserDefaults and a Settings Bundle to modify the URL. It would then be a user preference which can have a sensible default, but then can be changed from outside the app without recompilation. See the "Implementing Application Preferences" section of Apple's iOS Application Programming Guide.
If my comment to Christian's answer is valid, why don't you use an actual domain name instead of a server address? Then it doesn't matter if your IP changes.
精彩评论