开发者

XCode project - macro for unique server addresses for each developer

As I develop an iPhone app that speaks to a Rails app running on my laptop, I'll do something like,

    model.serverIp = @"192.168.0.23";

I'll commit this, and the next guy chec开发者_StackOverflow社区ks it out, and changes it to his IP address, and then commits, and then I have to change it........

What's the best way to avoid stepping on each other's toes here?


For development purposes it may suffice to one of several things:

  • Specify an external file that is not checked in which contains the relevant IP address and is added as a resource file to the iPhone app
  • Add code to the application so it can discern the IP address automatically
  • Use a loopback address (assuming the test server is always running on the same machine as the iPhone app)
  • Deploy a common server with a fixed IP address for everyone to use
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜