views:

366

answers:

1

Hi,

Have the folder structure like

*Resources/books/CD_en/icon/0.jpg; *Resources/books/CD_en/icon/1.jpg; *Resources/books/DD_en/icon/0.jpg; *Resources/books/DD_en/icon/1.jpg;

how to get resource path from NSBundle using the subpath 'books/CD_en/icon/0.jpg';

I tried using, - (NSString *)pathForResource:(NSString *)name ofType:(NSString *)extension inDirectory:(NSString *)subpath

[[NSBundle mainBundle] pathForResource:@"0.jpg" ofType:@"jpg" inDirectory:@"books/CD_en/icon"];

but it returns nil;

Please help me.

+1  A: 

I got it. Simply we need the add the folder structure 'books/...' to the app Resource folder. Which will display in blue color.

Then the existing code is running successfully.

Thanks to yehnan.

Suresh Kumar