2011-09-09 7 views
0

こんにちは私は、そのアプリケーションで1つのアプリケーションを作成しました私はjsonを使用してflickrから写真を取得していて、サムネイルとスライドショーとしてこれらの写真を表示している場合、ユーザーがflickrからそれらの写真をいくつか保存したいと思ったらどうすればいいですか?NSDefaultManager BTのdosen't作業は、インターネットから写真を保存するには?

- (IBAction)saveImage 
    { 
     NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,  NSUserDomainMask, YES); 
     NSString *documentsDirectory = [paths objectAtIndex:0]; 
     NSString *savedImagePath = [documentsDirectory  stringByAppendingPathComponent: @"savedImage.png"]; 
     [imageData writeToFile:savedImagePath atomically:NO]; 
    } 
+2

あなたのコードは正常に見えます。それはどうしたらうまくいかないのですか? –

+0

"does not work"は障害の説明ではありません。 – hop

答えて

0
 try this code for the same//. 


NSString *videoDocPath1 = [[NSString alloc] initWithString:[[[[NSBundle mainBundle] resourcePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"Documents"]]; 
NSString *videofilePath1; 
videofilePath1 = [videoDocPath1 stringByAppendingPathComponent:[NSString stringWithFormat:@"screensever.mp4"]]; 
[ScreenseverVideo writeToFile:videofilePath1 atomically:YES]; 
関連する問題