Xcode 5 Tutorial - Window close event changed into hiding event

来源:互联网 发布:中世纪2优化9翼骑兵 编辑:程序博客网 时间:2024/06/06 15:02
#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




0 0
原创粉丝点击