Overriding private method w/o warning
Overriding private method w/o warning
- Subject: Overriding private method w/o warning
- From: David Dunham <email@hidden>
- Date: Mon, 07 Sep 2009 13:50:47 -0700
Unfortunately, my Cocoa app needs to override -[NSApplication
_shouldTerminate], which is private. (Sequencing is subtly different
between quitting from the application menu and via Apple Event, which
is why I think I'm stuck with this. Suffice to say it works, and I've
attempted to future-proof.)
In the past, I used
BOOL retVal = [(id) super _shouldTerminate] != 0;
where the cast suppressed a warning. But that gives an error with
clang, so I'm back to
BOOL retVal = [super _shouldTerminate] != 0;
warning: method '-_shouldTerminate' not found (return type defaults to
'id')
is a lot better than
error: cannot cast 'super' (it isn't an expression)
but my question is: is there a way to write this that keeps clang
happy? I'm not sure how to call objc_msgSendSuper...
David Dunham
Mobile: +1 206 769 2227 http://www.pensee.com/dunham/
Imagination is more important than knowledge. -- Albert Einstein
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden