Displaying a Cocoa Window as a Sheet in Xcode 4 (OSX 10.7.2) with ARC

Tutorial for Xcode 4 Create new project and add the following to AppDelegate.h and AppDelegate.m. AppDelegate.h #import <Cocoa/Cocoa.h> @interface AppDelegate : NSObject <NSApplicationDelegate> { IBOutlet NSPanel *theSheet; } @property (assign) IBOutlet NSWindow *window; @end AppDelegate.m #import “AppDelegate.h” @implementation AppDelegate @synthesize window = _window; – (IBAction) showTheSheet:(id)sender { [NSApp beginSheet:theSheet modalForWindow:(NSWindow *)_window modalDelegate:self didEndSelector:nil contextInfo:nil]; } … Read more