tags:

views:

1569

answers:

3

Hi all,

I try to manipulate file in sub directory in my project root directory.

I have folder with name "Basic Usage HTML" and i try this code:

[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:@"Basic Usage HTML" ]isDirectory:YES] ]

And it's return "nil string parameter"

Any idea ?

+3  A: 

Most likely Xcode's build process isn't including the "Basic Usage HTML" subfolder in your build.

Also, you may want to split each statement out and NSLog them to see where it's failing.

rpetrich
A: 

I had a similar problem and it was due to the target not being setup to copy (or compile) the resource when building.

Jason
A: 

Why did you set isDirectory to YES? That looks like the bug here. (Early morning coffee alert)

St3fan