English 中文(简体)
有两个目标,分别有:
原标题:Two targets with separate .xib (image resources with same names)

我有一个有两个目标的项目:appAappB

两个主要观察控制器的<共享代码>,但<>文档除外。

我还有两套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.

最佳回答

至今没有答复。

因此,请允许我回答我自己的问题(希望得到更好的回答)。

When you want to edit .xib of one target, you remove the references of the other targets resources (pngs).

Then you quit xcode and open your project again. The pngs will be the right ones (since xcode doesn t hold references to the wrong ones at the moment).

When you re done - reimport deleted references (take care that you check the right target membership ).

Edit:这似乎是与IB-XCode的一个已知问题。 如果他们解决了这一问题,我们就不得不使用上述工作。

问题回答

暂无回答




相关问题
How to change out-of-focus text selection color in Xcode?

Okay, I ll bite. I ve got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, ...

Iphone NSTimer Issue

Hi I am new to objective c. I am trying to make an app for iphone. I have a button on my view, and the click on which the function playSound is called. This is working properly. It does plays the ...

Include a .txt file in a .h in C++?

I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Xcode open two editor windows with same file

Is it possible to open the same file in two separate windows in Xcode. I can open a file in one window and the same file in the main Xcode editor window, but I wanted two separate fulltime editor ...

Forcing code signing refresh in Xcode

In our environment, we share resources across multiple projects and platforms. When building for iPhone, only a subset of those resources are needed. Since that subset is still considerable, we have ...

热门标签