views:

66

answers:

1

Hi Everyone,

Is it possible to use double names for images into the resource group?

Thanks :)

+1  A: 

You can have multiple resources with the same name as long as (1) they are not in the same directory, and (2) You've added the resources to your Xcode project by reference.

(1) because no directory can contain two files with the same name

(2) because Xcode respects directory structures for directories added by reference (if you add it directly to the project, Xcode tosses everything into the root level of the application bundle)

Shaggy Frog
Oke thanks, but at Interface Builder i only see 1 image with the same name, but i add 2 images with the same name in different groups.And also into some Objective-C code i use "test.png" and not "cars/test.png" with the group name, sorry i'm a bit confused.
iMuller
To elaborate: Add "cars" as a "folder reference" (it gives you the option when you drag it into Xcode) and load the image using imageNamed:"cars/background.png". Note that this potentially misses an important step: it does *not* run `pngcrush -iphone` on the images (it simply copies the directory contents), so they potentially load slower on device.
tc.