How to compile resource files conditionally in Xcode?
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 g开发者_开发问答ood if it can be specified in source code file. Any recommended method?
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.
精彩评论