• 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: How to get a Category method?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get a Category method?


  • Subject: Re: How to get a Category method?
  • From: Ondra Cada <email@hidden>
  • Date: Mon, 15 Mar 2004 00:45:33 +0100

Rosyna,

On Monday, Mar 15, 2004, at 00:22 Europe/Prague, Rosyna wrote:

Neither class_getInstanceMethod nor respondsToSelector: says the class responds to the selector even though it does (via a category).

You sure?

18 /tmp> > q.m
#import <Foundation/Foundation.h>
int main() {
[NSAutoreleasePool new];
NSLog(@"responds: %d",[NSString respondsToSelector:NSSelectorFromString(@"justATest")]);
return 0;
}

@implementation NSString (JustATest)
+(void)justATest {}
@end
19 /tmp> cc -Wall -framework Foundation q.m && ./a.out
2004-03-15 00:44:32.371 a.out[23735] responds: 1
20 /tmp>

---
Ondra Hada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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.


  • Follow-Ups:
    • Re: How to get a Category method?
      • From: Rosyna <email@hidden>
References: 
 >How to get a Category method? (From: Rosyna <email@hidden>)

  • Prev by Date: Re: Faceless app showing window?
  • Next by Date: Re: How to get a Category method?
  • Previous by thread: How to get a Category method?
  • Next by thread: Re: How to get a Category method?
  • Index(es):
    • Date
    • Thread