问题描述:

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 shouldMoveItemAtPath:(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.

相关阅读:
Top