 <p>You should register your controller as the open panel's delegate and then implement the <code>-panel:isValidFilename:</code> delegate method. Returning <code>NO</code> from that method allows you to prevent the open dialog from being closed:</p> <pre><code>- (BOOL)panel:(id)sender isValidFilename:(NSString *)filename { //validate the field in some way, in this case by making sure it's not empty if([[textField stringValue] length] == 0) { //let the user know they need to do something NSAlert *alert = [[NSAlert alloc] init]; [alert setMessageText:@"Please enter some text."]; [alert addButtonWithTitle:@"OK"]; [alert beginSheetModalForWindow:sender modalDelegate:nil didEndSelector:NULL contextInfo:NULL]; //return NO to prevent the open panel from completing return NO; } //otherwise, allow the open panel to close return YES; } </code></pre>