0

In my app i have the following setup :

// .h
@interface MyDocument : NSPersistentDocument <NSApplicationDelegate>
{
   ...
}

// .m
@implementation MyDocument

-(void) applicationDidBecomeActive:(NSNotification *)notification
{
   ...
}

The applicationDidBecomeActive never gets called for some reason. Does anyone know I'm missing here?!

Eugene Gordin
  • 4,047
  • 3
  • 47
  • 80
  • 1
    Do any other `NSApplicationDelegate` methods get called? You might not be setting the document as the application's delegate, but rather simply saying that it supports the interface. It's like saying "I can do the job" but not actually signing up for the job. Just a theory. – Carter Pape May 22 '13 at 01:07
  • ahahah...great analogy! Probably it's not set up correctly. How would I do so? – Eugene Gordin May 22 '13 at 01:10
  • just got it working...easy fix in NIb! Thank you, so much! – Eugene Gordin May 22 '13 at 01:11
  • No problem; the same problem has actually plagued me before as well, so that was my first thought! – Carter Pape May 22 '13 at 01:15

1 Answers1

1

Thanks to Carter's comment, I figured out that in the nib file application delegate is not linked to File's Owner (MyDocument). There fore, linking those two fix the problem!

Eugene Gordin
  • 4,047
  • 3
  • 47
  • 80