2

In my mac os x app, I subclass NSApplication and override it's -sendEvent: method. Apple complains :

The app includes 'OBJC_IVAR_$_NSApplication._delegate' from the framework '/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit'.

What can I do about that? What am I doing wrong?

Fatso
  • 1,278
  • 16
  • 46
  • Can you post your code? Error messages aren't easy to decipher without any context... – Andrew Madsen Dec 13 '11 at 17:39
  • There is no context ... The above 'error' is a complaint of Apple's support team. They accuse me of using private API, which is not true... – Fatso Dec 13 '11 at 18:23
  • 1
    @Korion: No, Apple's support team does not personally write you messages every time you do a build. The message is from the compiler, and it has nothing to do with your override of `sendEvent:` (note that `sendEvent:` is not even mentioned in it). – Peter Hosey Dec 14 '11 at 18:11

1 Answers1

8

You are accessing the application delegate by directly referring to the _delegate ivar, like this:

NSLog(@"my delegate = %p", _delegate);

You need to use the delegate accessor method, like this:

NSLog(@"my delegate = %p", self.delegate);
rob mayoff
  • 375,296
  • 67
  • 796
  • 848