سؤال

I am new to programming for Mac (not iOS but OS X) and so have run into a problem. The template providing a document based application doesn't come with an appDelegate class. Only class provided and used is the NSDocument subclass.

My Problem: Where do I put the - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender (or equivalent) method I need in order to call a NSAlert? If I place it into my NSDocument subclass, it never gets called.

Thanks for any help.

هل كانت مفيدة؟

المحلول

Solved it! Just had to implement my own AppDelegate class (however I didn't know how to do this. I just looked in a test app (non document base) how it goes).

Also, I looked here: X-Code Interface Builder Not showing App Delegate Object

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top