jjzjj

moveItemAtPath

全部标签

objective-c - 使用 moveItemAtPath 将文件夹移动到 temp 时出现奇怪错误。 cocoa 错误 516

我尝试将包含文件的文件夹移动到临时文件夹,但我总是收到相同的错误:操作无法完成。(cocoa错误516。)这是代码,你看到什么奇怪的了吗?提前致谢。//createnewfolderNSString*newPath=[[selfgetDocumentsDirectory]stringByAppendingPathComponent:@"algo_bueno"];NSLog(@"newPath%@",newPath);if([[NSFileManagerdefaultManager]fileExistsAtPath:newPath]){NSLog(@"newPathalreadyexis

ios - NS文件管理器 :moveItemAtPath

NSString*path=[[NSBundlemainBundle]pathForResource:@"js"ofType:nil];NSArray*paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);if(path!=nil){NSFileManager*fm=[NSFileManagerdefaultManager];NSString*move_path=[NSStringstringWithFormat:@"%@",[pathsobjectAtIndex:0]];