开发者

Warning message related to NSFileManager

NSString *newPath = [[theFileName stringByDeletingLastPathComponent] stringByAppendingPathComponent:str];
    [[NSFileManager defaultManager] movePat开发者_JS百科h:myString1 toPath:newPath handler:nil];

warning message?: NSFileManager may not respond to '-movePath:toPath:handdler'

what is that?


movePath: is a deprecated function as of Mac OSX 10.5+

Which version of iOS/MacOSX are you targeting?

Also, Apple suggest to use moveItemAtPath:toPath:error: instead.


You should use moveItemAtPath:toPath:error: not movePath:toPath:handler:.

The movePath:toPath:handler: is not available on iOS.

Look at NSFileManager Class Reference for iOS.


You probably need moveItemAtPath:toPath:error:.

NSError * error = nil;
[[NSFileManager defaultManager] moveItemAtPath:oldPathInFull toPath:newPathInFull error:&error];
if ( error ) {
    /* Error renaming the file. */
}

You can look at this tutorial too.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜