• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Overriding private method w/o warning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Overriding private method w/o warning
      • From: Jens Alfke <email@hidden>
  • Prev by Date: llvm-gcc
  • Next by Date: Re: llvm-gcc
  • Previous by thread: Re: llvm-gcc
  • Next by thread: Re: Overriding private method w/o warning
  • Index(es):
    • Date
    • Thread