I wrote a Cocoa Application and I got EXC_BAD_ACCESS error when I\'m closing an application window. I read that this error usually means problems with memory, b
The crash is caused by the fact that you made the window your application's delegate. When you close the window, that is the last release that kills it off, and if it's the last window you had up, it causes the application to ask its delegate whether it should quit. Since the window you just killed off is the application's delegate, you get that crash.
Longer explanation and suggestion of solution in my answer on your subsequent question.