Reputation: 673
I have folder inside reource folder lets say
resource->folder A->61.png
so how to access this path I did this
NSString *myFilePath= [[NSBundle mainBundle] pathForResource:@"61" ofType:@"png" inDirectory:@"A" ];
NSLog(@"file is at %@",myFilePath);// its null
why my path is null?
Upvotes: 0
Views: 916
Reputation: 673
This is the answer for anyone who is looking for it.
You need to import the directory into your app using the following method:
You’re done!
Upvotes: 2
Reputation: 46037
You do not need to use inDirectory. Even if you create directory under resource folder, all resources go to a flat directory under app bundle.
NSString *myFilePath= [[NSBundle mainBundle] pathForResource:@"61" ofType:@"png"];
Upvotes: 1