tags:

views:

30

answers:

1

hi i am new to iphone.what i did is creating a local folder named images and add images one by one as UIImage imageNamed:@"image.jpg".Instead if i am adding one by one is there any way to add images automatically to project from local folder.When i place any new image in the folder it automatically added to project bundle.How can i done this pls help me.post any code.Thank u in advance.

A: 

Remove the individual images from your project's resources. Now do Add -> Existing Files... and select the folder that contains your images.

In the dialog that comes up, select "Create Folder References for any added folders". This will add the entire folder as a resource within your project. Now when you add any files to that folder, they'll automatically be installed as resources within your app. You'll no longer need to add each file individually.

Note: This installs the entire directory structure within your resources folder, so you'll need to change your code to load the files from the appropriate subdirectory.

cduhn
... or load them with the help of `NSBundle` class.
kpower