Hack Saw
Hack Saw

Reputation: 2781

How to get NSBundle URLsForResourcesWithExtension to return actual URLs?

I'm trying to be a good doobee and use URLs everywhere. When I invoke

(gdb) po [[NSBundle mainBundle] URLsForResourcesWithExtension:@".aif" subdirectory:nil]

<__NSCFArray 0x6a02150>(
drip.aif -- /Users/hacksaw/Library/Application Support/iPhone Simulator/4.3.2/Applications/CF4B60C1-D8E1-4CEA-B7CF-DE57F88E1023/SuperTimer.app/

Which is the right path, but not at all a URL.

Is it somehow unreasonable to expect that the array returned from this method would contain actual URLs?

What's the proper way to find all my .aif's I included with my bundle?

Upvotes: 0

Views: 834

Answers (1)

Rob Napier
Rob Napier

Reputation: 299633

This is an NSURL. When you print them out in the debugger with po, they just show their description, which is the name of the file, two hyphens and the name of the directory. But it's an NSURL.

Upvotes: 3

Related Questions