0

I am including a directory full of files in my app. I looked through the NSBundle docs, but I can't seem find out how to get the URL to this directory. I'm trying to use the main bundle object.

I have a directory "defaultImages" under a directory "Resources" in xCode. I have confirmed that these are being copied to the device, how do I get the URL to them?

Specifically, the following does not work.

[[NSBundle mainBundle]:URLForResource:@"defaultImages" withExtension:@"" subdirectory:@"Resources"]; 
Thomas
  • 514
  • 3
  • 10

2 Answers2

0

Try

 NSString *filepath = [[NSBundle mainBundle] pathForResource:@"defaultImages" ofType:@"footype"];
Pinwheeler
  • 1,061
  • 2
  • 13
  • 26
0

Apparently NSBundle will not locate a directory for you. My solution was to put the contents of the directory inside a bundle, via How to make an iOS asset bundle?. I then added that bundle to my main application bundle.

Community
  • 1
  • 1
Thomas
  • 514
  • 3
  • 10