Using resources with the same name in Xcode

Posted by Roberto on Stack Overflow See other posts from Stack Overflow or by Roberto
Published on 2010-12-20T22:29:47Z Indexed on 2010/12/23 16:54 UTC
Read the original article Hit count: 200

Filed under:
|
|

Is there a way to add multiple resources with the same name to an Xcode project and have 1 of them take priority over the others?

Example: I added 2 files, both called icon.png, to an Xcode project. They are on different folders in the file system (Folder1/icon.png and Folder2/icon.png) and on different groups in Xcode. Is there a way to tell Xcode to have Folder2/icon.png take priority over Folder1/icon.png? And if only 1 icon.png exists, then use that one.

Thanks.

EDIT (2010-12-23):

You can have multiple files with the same name in an Xcode project even if they are not in separate folder references, but they are in separate groups. Once compiled, the app bundle (which will be flat with no folders in it), will only have one copy of the file (icon.png). How do you pick which copy of the file to use?

I was told that you can do this for BlackBerry. It works something like this: The compiler will go down the list of files in the project and start adding them to the app bundle. If it sees a duplicate, it will overwrite it (or not), so the files at the bottom (or at the top) will have higher precedence and will be the final bundle.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about xcode