- (UIImage*)thumbnailImage:(NSString*)fileName
{
UIImage *thumbnail = [thumbnailCache objectForKey:fileName];
if (nil == thumbnail)
{
NSString *thumbnailFile = [NSString stringWithFormat:@"%@/thumbnails/%@.jpg", [[NSBundle mainBundle] resourcePath], fileName];
thumbnail = [UIImage imageWithContentsOfFile:thumbnailFile];
[thumbnailCache setObject:thumbnail forKey:fileName];
}
return thumbnail;
}
このコードはhttp://www.alexcurylo.com/blog/2009/01/13/imagenamed-is-evil/から入手しました。誰かがこのコードの使い方を教えてもらえますか?imageNamedの代わりにこれを使用する方法について少し助けが必要です。