NSString *itemPath = @“icon.png”;
NSArray *aArray = [itemPath componentsSeparatedByString:@"."];
NSString *filename = [aArray objectAtIndex:0];
NSString *sufix = [aArray objectAtIndex:1]
NSString *imagePath = [[NSBundle mainBundle] pathForResource:filename ofType:sufix];
本文详细介绍了如何在iOS应用中获取工程目录下的资源文件路径,通过使用NSBundle和componentsSeparatedByString方法,可以轻松实现路径的解析。
3925

被折叠的 条评论
为什么被折叠?



