【发布时间】:2013-09-28 21:16:43
【问题描述】:
看来:
[[NSBundle mainBundle] pathForResource:@"name" ofType:@"png"];
不为 Images.xcassets 资产目录中的资产返回任何内容。我也试过了:
[[NSBundle mainBundle] pathForResource:@"name" ofType:@"png" inDirectory:@"Images"];
[[NSBundle mainBundle] pathForResource:@"name" ofType:@"png" inDirectory:@"Images.xcassets"];
但这些都不起作用。
有没有人成功检索到目录中资产的路径?
【问题讨论】:
-
遇到同样的问题!
-
我还需要图像的实际路径,因为我不想使用 imageNamed(损坏的缓存),事实证明资产目录也损坏了,没有程序访问。
-
@MobileVet 你找到解决方案了吗?
-
@Keab42 不,我刚刚遇到了另一个我想要的案例! :)