• 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: What's with these redundant methods ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: What's with these redundant methods ?
      • From: MarketLogix Developer <email@hidden>
References: 
 >Re: What's with these redundant methods ? (From: MarketLogix Developer <email@hidden>)

  • Prev by Date: Re: What's with these redundant methods ?
  • Next by Date: Pasteboard and... How to tell an application to paste or to copy...
  • Previous by thread: Re: What's with these redundant methods ?
  • Next by thread: Re: What's with these redundant methods ?
  • Index(es):
    • Date
    • Thread