Re: NSLog(@"%@",[NSProxy class]);
Re: NSLog(@"%@",[NSProxy class]);
- Subject: Re: NSLog(@"%@",[NSProxy class]);
- From: glenn andreas <email@hidden>
- Date: Sat, 11 Mar 2006 22:55:10 -0600
On Mar 11, 2006, at 9:59 PM, Agent M wrote:
How do you figure that NSProxy is broken?
It is documented to implement exactly 4 class methods (and being a
root class inherits nothing more) - and "+ description" is not one
of them (like it is for NSObject).
It implements exactly what it says it does - just because it
doesn't work like NSObject doesn't mean it's broken...
Even if you do implement +description, it doesn't fix the
exception. Try it. Instead you have to implement a private method
in a category.
What is really going on is that NSProxy's meta-class is in fact a
weird NSProxy instead of an NSObject which I haven't been able to
think of a rational explanation for. If you can think of one,
please let us know- perhaps strict NSObject/NSProxy separation was
the idea, but an NSProxy is useless without something to proxy...
Because, according to the documentation, the metaclass of a root
class is suppose to be that class itself. See <http://
developer.apple.com/documentation/Cocoa/Reference/ObjCRuntimeRef/
index.html> down in the section where objc_class is defined:
isa
Points to the metaclass of this class. If this class is a
metaclass, the isa field points to the root metaclass (usually the
metaclass for NSObject, but also possibly the metaclass for NSProxy
or a root class of your own—a root class is any class that does not
inherit from another class). This also means that the isa field for
the metaclass of the root class points to itself.
The point is that a root class shouldn't have a dependancy on another
class, or it shouldn't be a root class.
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
Widgetarium | the quickest path to widgets
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden