discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why does NSDictionary respond to @selector(name)?


From: Pete French
Subject: Re: Why does NSDictionary respond to @selector(name)?
Date: Thu, 09 May 2002 21:39:20 +0100

> I would appreciate this. I don't know exactly but I don't think this is 
> OPENSTEP spec. A dictionary responding to -name sounds a bit weird to 
> me. I will probably not be(stay) the only one that gets caught by this.

Umm, isnt the 'name' method on a class actually part of the objective
C runtime ? I wrote my own foundation library at one point and I
use 'name' in orer to print the name of a class. I dont know of any other
way of doing it in fact.

e.g. the following program will compile and run on any system with gcc on it,

#include <objc/objc.h>
#include <objc/Object.h>

@interface TestClass : Object
@end

@implementation TestClass
@end

int
main()
{
        puts([TestClass name]);
        return 0;
}

so it may not be part of OpenStep, but I think its part of objc in
general.

-bat.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]