サーバーから画像をダウンロードして、320 ライブラリの TTThumbsViewController に表示しようとしています。私はこれを機能させることができません!
画像がローカルに保存されている場合、次のように機能します。
//Create thumbnails
[ImageUtils checkAndSaveThumbnail:imageName andSize:CGSizeMake(100.0, 100.0) andLocation:NO andPrefixof:@"small"];
NSString *fullImageName = [NSString stringWithFormat:@"documents://%@",imageName];
NSString *imageSmallName = [NSString stringWithFormat:@"documents://small-%@",imageName];
NSString *caption = [tempDict objectForKey:@"Comment"];
UIImage *tempImage = [UIImage imageWithContentsOfFile:[appDelegate filePath:imageName]];
MockPhoto *tempPicture = [[MockPhoto alloc] initWithURL:fullImageName smallURL:imageSmallName size:tempImage.size caption:caption photoname:imageName];
[photoArray addObject:tempPicture];
photoArray を MockPhotoSource に追加します。
self.photoSource = [[MockPhotoSource alloc]
initWithType:MockPhotoSourceNormal
title:@"Photos"
photos:photoArray
photos2:nil
];
[photoArray release];
...しかし、次のようにダウンロード場所を指定すると機能しません! サムネイルも大きな写真も表示されません。
NSString *url = [delegate downloadImageUrl];
MockPhoto *tempPicture = [[MockPhoto alloc] initWithURL:url smallURL:url size:tempImage.size caption:caption photoname:imageName];
[photoArray addObject:tempPicture];
私は AsyncImage と同じ URL を使用しており、画像をダウンロードして ImageView に表示できます。
NSURL *url = [NSURL URLWithString:[delegate downloadImageUrl]];
UIImageView *profileimage = [[UIImageView alloc] init];
AsyncImageView* asyncImage = [[[AsyncImageView alloc] initWithFrame:CGRectMake(0, 10, 60, 60)] autorelease];
asyncImage.imageName = [[users objectAtIndex:indexPath.row] objectForKey:@"Key"];
[asyncImage loadImageFromURL:url];
[profileimage addSubview:asyncImage];
MockPhoto の何が問題なのか教えてください。
ありがとう。