开发者

How to update a URL in xcode project without having to build the application again?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜