The original answer is from previous days when purchasing the application. The correct answer now is to send one binary file and offer your paid version through in application updates . This is a bit more code, but this is one batch, and your conversion rate is likely to be better.
However, if you still want to use versions of your application:
Xcode has good support for several purposes.
From the project menu, select "New Goal ...". Add another iPhone executable file (Cocoa Touch Application), then you can specify on the resource by resources which elements are included in your target. This may only include compiling certain code into your paid version.
You can quickly get visual feedback about what is and is not included in the current goal by right-clicking on the heading of the "Groups and Files" list (top sheets) and enabling the target membership.
You switch between building different goals just like you switch between a building for a simulator or iPhone.
To indicate how a particular class behaves during assembly, you can do two things: enable two versions of the class, each of which is created for its own purpose, or you can set the build time flag for the pre-processor. Select Target from the "Groups and Files" list, then "get information" for this purpose. Go to the assembly tab and search for "preprocess". You should see an element n called "Preprocessor Macros", add LITE to your simple target and add PAID to your paid target in the same way.
Thein in the source files that you can determine at compile time, which version you compile to use #ifdef LITE , etc.
Going further, you can set a global flag or AppDelegate member variable based on #ifdef LITE and change the runtime behavior for Lite and paid applications. Iām not sure I see the value in this.
Roger Nolan Feb 14 '09 at 18:59 2009-02-14 18:59
source share