• 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: NSLog(@"%@",[NSProxy class]);
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: NSLog(@"%@",[NSProxy class]); (From: Greg Herlihy <email@hidden>)
 >Re: NSLog(@"%@",[NSProxy class]); (From: Philippe Mougin <email@hidden>)
 >Re: NSLog(@"%@",[NSProxy class]); (From: glenn andreas <email@hidden>)
 >Re: NSLog(@"%@",[NSProxy class]); (From: Agent M <email@hidden>)

  • Prev by Date: Re: Code to Run on Application Load
  • Next by Date: Sheet in a non-document-based Application
  • Previous by thread: Re: NSLog(@"%@",[NSProxy class]);
  • Next by thread: Re: NSLog(@"%@",[NSProxy class]);
  • Index(es):
    • Date
    • Thread