I have an iPhone application in which I added the images(Group) directory to Resources(group). I want to access the images that are in images. I need a path to these images, so I am creating the following code.
NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"myImage1" ofType:@"png" inDirectory:@"images"];
NSLog(@"%@", imagePath);
Result:
(null)
I also tried this code
NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"myImage1" ofType:@"png"];
But this code gives me the result (null).
myImage1 way Resources/images/myImage1.png
I do not know what the problem is. Please suggest some corrections.
source
share