相关疑难解决方法(0)

pathForResource?不使用扩展(Iphone)

当我使用包中的路径创建图像时,这就是我正在做的事情:


UIImage *image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"image" ofType:@"jpg"]];
Run Code Online (Sandbox Code Playgroud)

我想要做的是尝试找到我的图像的路径,但不使用扩展名,而不使用'ofType'(因为我的图像的名称和她的扩展名存储在我的数据库中)类似的东西:


UIImage *image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"image.jpg"]];
Run Code Online (Sandbox Code Playgroud)

但我不知道该怎么做.

最好的祝福,

iphone cocoa objective-c

17
推荐指数
2
解决办法
1万
查看次数

标签 统计

cocoa ×1

iphone ×1

objective-c ×1