I’m not as methodical and organized with my iPhone development as I am at my day job. My version control system is Time Machine, I have PNG images scattered all over my desktop, and up until recently I was maintaining separate projects for my full and lite versions of each product. Why? Probably a bit of laziness and probably a bit of not thinking the time investment was worth the payoff. It’s quite possible this was a little more difficult to do in Xcode 3 as well, but I never attempted it.
So while I was gutting Tramp Stamp to remove OpenFeint and go Game Center exclusively, I decided to merge the projects. The first thing I did was launch FileMerge to compare the 2 projects and see what I was dealing with. If you haven’t used it, it’s probably one of the most useful hidden tools on my Mac next to Automator. The comparison showed only a handful of files and images were different.
The next thing I did was duplicate my target and change the PRODUCT NAME. Then I added a define (LITE_VERSION) to the compiler options. I then merged the source files that had differences using #ifdef to handle the two streams of logic. I then added _lite to all the relevant image names and changed/split any code that referenced them. Wallah! A few hours later and I had both projects running and merged into 1 more manageable project.
I did run across one problem where the simulator refused to launch the lite version. It would crash in main telling me that the app was already running. A little searching and I found out that a reboot would fix it (I had already tried to kill zombie processes). Sure enough it did. Seems to be attributed to the way the process ends some times. If I use the stop debug button, it seems to be better than shutting down the app from the simulator.
I am now doing the same with my other 3 apps. Up until this point my build settings had been intermixed between the project and target ones. Now I’m understanding the target settings a lot better and can change the appropriate ones. This probably won’t make me any more money or give me any more exposure in the app store, but somehow this gives me satisfaction and makes the thought off adding any future enhancements a whole lot more palatable.
Ok… now I really should get busy on my never-ending project. See ya next time!