【发布时间】:2013-02-24 05:47:41
【问题描述】:
我正在使用以下方法在 AQGridview 中显示图像:
数据模型.m:
-(id)initWithCaption:(NSString*)theCaption andImage:(UIImage*)theImage andURLRequest:(NSURLRequest *)theURLRequest
{
self = [super init];
if(self)
{
self.caption = theCaption;
self.image = theImage;
self.myURLRequest = theURLRequest;
}
return self;
}
然后:
DataModel *appService = [[AppsDocumentService alloc] initWithCaption:theAppName andImage:[UIImage imageNamed:iconIdentifier] andURLRequest:requestObject];
其中iconIdentifier 是与应用支持文件夹中的图像匹配的字符串,例如@"Icon.png"
它只适用于存储在支持文件/Xcode 项目文件夹中的图像,我希望能够显示应用程序文档目录中的图像。
我尝试了一些变化:
iconIdentifier = @"/var/mobile/Applications/28CC364F-0895-4556-9F58-DAB5AB9104A7/Documents/downloads/AppIcons/Icon.png";
但这不起作用。
我希望有人能告诉我是否有办法修改我已经必须显示文档目录中的图像。
【问题讨论】:
标签: ios objective-c nsdocumentdirectory aqgridview