Re: What's with these redundant methods ?
Re: What's with these redundant methods ?
- Subject: Re: What's with these redundant methods ?
- From: "John C. Randolph" <email@hidden>
- Date: Tue, 22 Apr 2003 16:40:54 -0700
On Tuesday, April 22, 2003, at 04:04 PM, MarketLogix Developer wrote:
On Tuesday, April 22, 2003, at 09:19 AM, j o a r wrote:
Why don't you inherit from NSObject? Easier all around...
Not portable. My ObjC code currently runs on NeXT, FreeBSD, linux,
Solaris and even windoze(w/cygnus). I would need a much more
compelling
reason to inherit from a repackaged root class than to pick up on
these 2.
Object doesn't respond to these methods, but the similar:
- (BOOL) respondsTo:(SEL)aSelector;
- (IMP) methodFor:(SEL)aSelector;
I know. That's why I said that I added a category that reimplements
the NSObject
versions by calling these 2.
My question was more "why were these reimplemented in NSObject" ?
To conform to the new method naming guidelines, which call for more
descriptive names, eg: -performSelector:withObject: instead of
-perform:with:, or
In fact, while I'm at it, why is there an NSObject ?
Mostly to avoid breaking existing NeXTSTEP code.
Object was lacking in many ways, the main one being that it's only
memory management were the +alloc and -free methods. To implement
distributed objects, we needed to have reference counting and adding it
to Object really wasn't feasible.
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
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.