mrrrk
mrrrk

Reputation: 2301

Monotouch Condtitional Compilation for Distribution

I'm aware you can include directives to compile and run different code based on whether you're in debug or release mode. Can you do the same sort of thing when you build the project for distribution?

I ask because I've just submitted and had approved an app update which points to a web service on our test server rather than live!

Upvotes: 3

Views: 212

Answers (1)

jonathanpeppers
jonathanpeppers

Reputation: 26495

Yes, you sure can.

In MonoDevelop under Project Options->Compiler->Define Symbols, choose the appropriate build configuration (AppStore), and you can make a new variable such as PRODUCTION.

You can then use:

#if PRODUCTION
#endif

Throughout your code.

Upvotes: 2

Related Questions