ios - Dynamically adding resources to XCode project, always one cycle behind -


i need assemble resources application depeding on xcode build settings. easiest way achieve this, through build script phase. although works, somehow builds target resources 1 version lagging (a second build needed things up-to-date). resources folder reference folder in script (or rather, custom built command line tool called script) copies appropriate resources. run script build phase first (topmost) phase in target.

a solution i've found on web somewhere, create "external target" , add original target's build phases (by dragging external target onto original target). indeed seem fix "one version behind" issue, cannot seem current target's environment variables passed "external target".

why xcode not including updated resources? other alternatives there?

you try define internal target (say, "resourcetarget") , make main target dependent on resourcetarget. let script run in script build phase of resourcetarget, resources updated when second target build.

that way, environment variables should same.


Comments