Burak
Burak

Reputation: 5764

Getting UIImage from different directories in Resources folder

I want to put my images into different directories in Resources folder. For example I have 1.jpg (large) and 1.jpg (thumbnail). So I want to locate them 2 different directories.

If I want to get them, I should use [UIImage named:@"large/1.jpg"]

Upvotes: 0

Views: 469

Answers (1)

Felipe Sabino
Felipe Sabino

Reputation: 18225

Use should use a bundle for that

http://developer.apple.com/library/mac/#documentation/CoreFoundation/Conceptual/CFBundles/AboutBundles/AboutBundles.html

Actually, using a bundle is also a nice way to separate and organize resources for an application with target for different devices.

To create a bundle for your resources you could do the following:

  1. File -> add new file
  2. Select the Resources menu
  3. Select Settings bundle
  4. Choose the file name and location

To start using that bundle only for images and other resources, you can delete all default files that are already there (which are specific for the settings bundle and your are not using this bundle for that)

An interesting point is that, while working with bundles, you will not manage your budle files through XCode anymore, you will have to add/remove them only in Finder.

Upvotes: 1

Related Questions