我有一个有两个目标的项目:appA和appB。
两个主要观察控制器的<共享代码>,但<>文档除外。
我还有两套png s。 每项目标。
My file/project structure looks like:
*common* (members of both targets):
appViewController.h
appViewController.m
*appA* (members of target appA):
appViewController.xib
set of png files
*appB* (members of target appB):
appViewController.xib
set of png files
两组都有相同的名称,但被单独放在夹/组中,一个组属于一个目标,另一个组则属于另一个目标(与编号为“Controller”)。
Everything works fine except when i try to edit .xib files in IB - it seemes to get confused and show partly images from one target and partly from the other.
Since .xib s are somewhat complex (>40 images) editing one with partly wrong images is almost impossible - images have to be properly placed on one background image (background image is also different for appA and appB).
The problem exists only at edit-time (in IB). After compilation all the images in both targets are correct.
I found one quick & dirty solution to this. Before i start editing one .xib i remove references to the other set of png s. That way IB shows correct images for the .xib i m editing. I simply import back all the references (png s of the other target) when i m done.
I found a similiar question which was not really answered.
I wonder, does anyone have a cleaner solution to this? There has to be a better way to do it.