Xcode 5 Tutorial - Window close event changed into hiding event

#import <Cocoa/Cocoa.h>

@interface AppDelegate : NSObject <NSApplicationDelegate,NSWindowDelegate>

@property (assign) IBOutlet NSWindow *window;

@end


#import "AppDelegate.h"

@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    // Insert code here to initialize your application
    self.window.delegate = self;
}
-(BOOL)windowShouldClose:(id)sender
{
    
    [[NSApplication sharedApplication] hide:self];
    return NO;
}
@end




你可能感兴趣的:(Xcode 5 Tutorial - Window close event changed into hiding event)