I'm trying to show a custom modal sheet when the user clicks a button in a document based application. In that sheet the user can enter text and click two button: a cancel and ok button. I've read the documentation and I followed this tutorial. However, I can't get it to work. I've created a MyCustomSheet.xib file with a MyCustomSheet class that is a sub-class of the NSWindowController. In that class I only implement the closeMyCustomSheet method, from the tutorial. In the MyDocument class I've implemented the other functions. I've also created an instance variable myCustomSheet of type NSWindow. I get a couple of errors and don't know how to fix them. These are my errors: error: statically allocated instance of Objective-C class 'NSWindow' error: wrong type argument to unary exclamation mark error: incompatible type for argument 1 of 'beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:' error: 'myCustomSheet' undeclared (first use in this function) Could you guys help me?