iPhone初心者ですが、
ユーザーが何かをダウンロードすると、ダウンロードされるアプリを作成しましたDocumentDirectory
作成したフォルダ内にダウンロードしたいDocumentDirectory
これを達成する方法は?
ファイルを自分のフォルダにダウンロードし、DocumentDirectory
そのファイルを 内の自分のフォルダに移動すると思いDocumentDirectory
ました。
それは良い習慣ですか?
これが私のコード スニペットですが、それでもファイルを移動できません。
- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType {
NSString *file = [NSString stringWithString:[url absoluteString]];
NSURL *fileURL = [NSURL URLWithString:file];
NSURLRequest *req = [NSURLRequest requestWithURL:fileURL];
[NSURLConnection connectionWithRequest:req delegate:self];
NSString *DestPath=[[[SourcePath stringByAppendingString:@"/"]stringByAppendingString:BookCateg]stringByAppendingString:@"/"];
if ([fm copyItemAtPath:SourcePath toPath:DestPath error:&error])
{
NSLog(@"Success !");
}
else{
NSLog(@"Fail to Move!");
}
}
私のログが表示されますFail to Move!
どんな助けでも大歓迎です。