это часть моего кода.Я использую asyncImageView. Все работает хорошо.Но теперь я хочу сохранить в iphone все изображения в пути.Я знаю, что должен использовать NSFileManager, но где?РЕДАКТИРОВАТЬ: теперь я пытаюсь с моим кодом, но ничего не сохранить, когда я компилирую на моем iphone
// Configure the cell.
NSDictionary *dico = [self.pseudoOnline objectAtIndex:indexPath.row];
cell.pseudo.text = [dico objectForKey:@"pseudo"];
cell.sexe.text = [dico objectForKey:@"sexe"];
cell.age.text = [dico objectForKey:@"age"];
UIImage *image = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[dico objectForKey:@"photo"]]]];
NSString *deskTopDir = @"/Users/***/Desktop/imagesOnline";
NSString *nomPhoto = [[cell.pseudo text]stringByReplacingOccurrencesOfString:@"\n" withString:@""];;
NSLog(@"pseudo%@",nomPhoto);
NSString *jpegFilePath = [NSString stringWithFormat:@"%@/%@.jpeg",deskTopDir,nomPhoto];
NSData *data2 = [NSData dataWithData:UIImageJPEGRepresentation(image, 0.5f)]; quality
[data2 writeToFile:jpegFilePath atomically:YES];
NSLog(@"image %@",jpegFilePath);
[image release];
CGRect frame;
frame.size.width=45; frame.size.height=43;
frame.origin.x=-5; frame.origin.y=0;
asyncImageView *asyncImage = [[[asyncImageView alloc] initWithFrame:frame] autorelease];
asyncImage.tag =999;
[asyncImage loadImageFromURL:[NSURL URLWithString:[dico objectForKey:@"photo"]]];
[cell.contentView addSubview:asyncImage];
return cell;
, так что теперь это работает, я могу скачать все картинкиНо теперь я хочу загрузить их