• 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: "current" selector as string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "current" selector as string


  • Subject: Re: "current" selector as string
  • From: Clark Cox <email@hidden>
  • Date: Thu, 24 Jul 2003 19:11:28 -0400

On Thursday, July 24, 2003, at 16:05, Prachi Gauriar wrote:

On Thursday, July 24, 2003, at 6:09 AM, Sailor Quasar wrote:

On Thursday, July 24, 2003, at 04:08 PM, Thomas Deniau wrote:
But now I want to find out the name of the method the error occured in
by using its SEL. So what I'd need is some kind of function to find out
the current SEL....
current SEL : _cmd
so as string : NSStringFromSelector(_cmd);

i.e. for example NSLog(@"The error occured in -[%@
%@]",NSStringFromClass(isa),NSStringFromSelector(_cmd));

Hmm... Does anyone know how to know if it's + or - automatically ?

[self isKindOfClass:[Class class]] would answer that, I would think


I tried this and I get the error "`Class' is not an Objective-C class name or alias". Is this a bug? I would think that you should be able to send a message to Class, but that doesn't seem to be the case (in Xcode and Panther preview). Anyone else having this problem? I haven't got around to installing Jaguar again, so I haven't tested on that.

No, Class is nothing more than a typedef. This makes no more sense than sending messages to id, or NSObject*:

[id someMethod]
[NSObject* someMethod]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: "current" selector as string (From: Sailor Quasar <email@hidden>)
 >Re: "current" selector as string (From: Prachi Gauriar <email@hidden>)

  • Prev by Date: Re: POSIX equiv to [nsBundle mainBundle] bundlePath]
  • Next by Date: Re: Hard Objc-Runtime question: objc_getClassList lies to me...
  • Previous by thread: Re: "current" selector as string
  • Next by thread: Re: "current" selector as string
  • Index(es):
    • Date
    • Thread