• 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
Re: Getting rid of Obj-C "may not respond to" warning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting rid of Obj-C "may not respond to" warning


  • Subject: Re: Getting rid of Obj-C "may not respond to" warning
  • From: Jayson Adams <email@hidden>
  • Date: Mon, 3 Sep 2007 20:05:08 -0700


On Sep 3, 2007, at 5:56 PM, Rosyna wrote:
My application is using an undocumented NSApplication method. I realize the possible dangers in this, and would like to get rid of the warning that GCC gives me. Is there a way to do so (without globally disabling the warning)?

respondsToSelector: and performSelector: then GCC has no reason to preprocess and warn. You might also want to get the instance method and make sure that the method types are identical to what you expect.

I'm not sure about that, but if you add an interface declaration for an NSApplication category that defines the private method, that should get rid of the warnings (no need to include an implementation).

So...

@interface NSApplication(PrivateMethods)

- (void)_specialMethodIShouldNotCall:sender;

@end

Somewhere before you call the private method.

Best,


__jayson

Circus Ponies NoteBook - Organization for a Creative Mind
www.circusponies.com



 _______________________________________________
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

References: 
 >Getting rid of Obj-C "may not respond to" warning (From: David Dunham <email@hidden>)
 >Re: Getting rid of Obj-C "may not respond to" warning (From: Rosyna <email@hidden>)

  • Prev by Date: Re: warning: local declaration hides instance variable
  • Next by Date: Re: warning: local declaration hides instance variable
  • Previous by thread: Re: Getting rid of Obj-C "may not respond to" warning
  • Next by thread: Re: Getting rid of Obj-C "may not respond to" warning
  • Index(es):
    • Date
    • Thread