Objective C - How to put a close button in window?
===

I'm having a problem on putting a close button in my window in objective C, I have created the button, but I don't know what the method I need to call to close the window, I have done this:



        -(void)awakeFromNib{
    
    //Create a button
        NSRect frame = NSMakeRect(350, 10, 100, 50);
        NSButton *btn = [[NSButton alloc]initWithFrame:frame];
        [btn setButtonType:NSMomentaryPushInButton];
        [btn setBezelStyle:NSRoundedBezelStyle];
        [btn setTitle:@"Close"];
        [btn setTarget:self];
        [btn setAction:@selector(closeWindow)];
        [view addSubview:btn];
    
    
    
    }
    
    
    -(void)closeWindow{}
        
I don't know what to put in close window method 
