views:

164

answers:

1

Hi. I have many image/video files should be included as resource. Their size overs 30MB. So it takes to much time when I compile them. This slows down my development speed.

So I'm finding a way to compile those some resource files conditionally. Like #ifdef directive in source code. It's good if it can be specified in source code file. Any recommended method?

+1  A: 

First, in your Target, move the "Copy Bundle Resources" step after the Compile and Link steps. I have never quite figured out why Apple wants to copy the resources first, but it's a major slow-down on development because you wind up copying resources even when there are compile errors.

Next, to actually run the program with only certain resources, you'll need to make two targets. In your lightweight target, just don't copy the resources you don't want. Unfortunately there's no easy way to keep the two targets in sync if you make changes to the build, but using xcconfig files will generally keep it pretty easy.

Rob Napier
Thanks. First method is really great!
Eonil