0

我想请用户使用 NSFileManager 的 delegatefileManager:shouldMoveItemAtPath:toPath 覆盖模式表中的文件:

是否有一种做法来阻止委托内的执行,显示模式表并在委托中获取返回值?

- (BOOL)fileManager:(NSFileManager *)fileManager shouldMoveItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath {

    // Ask the user - get a return value from modal sheet here - returnCode ?

    return returnCode ? YES : NO; // ??
}

谢谢

4

1 回答 1

0

您可以只返回 NO,等待用户回答,然后根据手中的选择自动重新执行操作。

这就是您可以在 iPhone 环境中执行的操作,但对您可以使用辅助线程执行的操作有所有限制。但看起来你在 OS X 上,我对此不太了解。

于 2010-11-11T22:28:41.930 回答