开发者

ask the user for overwriting files in a modal sheet using the NSFileManager 's delegatefileManager:shouldMoveItemAtPath:toPath:

I'd like to ask the user for overwriting files in a modal sheet using the NSFileManager 's delegatefileManager:shouldMoveItemAtPath:toPath:

Is there a practice to block execution within the delegate, show a modal sheet and get a return value into the delegate ?

- (BOOL)fileManager:(NSFileManager *)fileManager shouldMoveIt开发者_如何学GoemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath {

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

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

Thanks


You could just return NO, wait for the user to answer, and re-execute the action automatically with the choice in hand.

That's what you might do in the iPhone environment with all the limitations on what you can do with secondary threads. But it looks like you are on OS X, I don't know much about that.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜