上面 Shirkrin 的回答和PeyloW 的回答都很有用,我设法使用它pathForResource:ofType:inDirectory:
来访问我的应用程序包中不同文件夹中具有相同名称的文件。
我还在这里找到了一个更适合我的要求的替代解决方案,所以我想我会分享它。特别是,请参阅此链接。
例如,假设我有以下文件夹引用(蓝色图标,组为黄色):

然后我可以像这样访问图像文件:
NSString * filePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"pin_images/1/2.jpg"];
UIImage * image = [UIImage imageWithContentsOfFile:filePath];
作为旁注,pathForResource:ofType:inDirectory:
等效项如下所示:
NSString * filePath = [[NSBundle mainBundle] pathForResource:@"2" ofType:@"jpg" inDirectory:@"pin_images/1/"];