I found out how to create a window in Cocoa programmatically but can\'t figure out how to react to events. The window is not reacting to a Quit request or button click.
I found out how to create a window in Cocoa programmatically …
Why? Why not just make a nib?
The window is not reacting to a Quit request or button click.
How would you quit a window? This isn't Windows 3; applications can have multiple windows on Mac OS X. As such, closing a window and quitting an application are separate actions.
[[NSRunLoop currentRunLoop] run];
Except in rare circumstances, running the run loop is NSApplication's job, and you should leave that to it. Use NSApplicationMain or -[NSApplication run] to tell the application to run.