Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/101.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 我可以以编程方式列出Images.xcsets/Something中的文件吗?_Ios_Cocoa Touch - Fatal编程技术网

Ios 我可以以编程方式列出Images.xcsets/Something中的文件吗?

Ios 我可以以编程方式列出Images.xcsets/Something中的文件吗?,ios,cocoa-touch,Ios,Cocoa Touch,是否可以列出images.xcsets/Something中的所有图像,以便在表列表视图中显示它们 我试过: NSArray *pngs = [NSBundle pathsForResourcesOfType:@".png" inDirectory:@"Images.xcassets/Something"]; NSInteger count = [pngs count]; NSLog(@"%d", count); 。。。但收效甚微 谢谢 < P>不要尝试自己寻找图像文件——认为它们是应用程序包

是否可以列出images.xcsets/Something中的所有图像,以便在表列表视图中显示它们

我试过:

NSArray *pngs = [NSBundle pathsForResourcesOfType:@".png" inDirectory:@"Images.xcassets/Something"];
NSInteger count = [pngs count];
NSLog(@"%d", count);
。。。但收效甚微


谢谢

< P>不要尝试自己寻找图像文件——认为它们是应用程序包中的私有信息。相反,使用
imageNamed
(无需使用
@2x
或文件扩展名)按名称加载它们。

您是否查看了内置应用程序包中的文件?只是看了一下。我认为我的图像正在被编译成一个二进制文件:资产。car@ChristopherPatuzzo:正确,因此无法在运行时执行此操作。不过,您可以尝试在编译时使用运行脚本创建一个.plist文件。然后在运行时,您可以读取.plist。