• 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: MarketLogix Developer <email@hidden>
  • Date: Tue, 22 Apr 2003 18:40:34 -0700

On Tuesday, April 22, 2003, at 02:45 PM, Chris Hanson wrote:

At 9:02 AM -0700 4/22/03, MarketLogix Developer wrote:
Well, true I do not implement those but Object from the ObjC runtime does implement
respondsTo: and methodFor: and any class that I implement will inherit from Object and
so inherit these.

Not true. (Unless I misunderstand what you're saying.)

If you write

@interface Foo
{ }
@end

you've declared a new root class, not a subclass of NSObject or Object. You have to explicitly specify a superclass if you want to create a subclass. If you're doing Cocoa development, you should generally be subclassing NSObject or one of its subclasses, or if you're creating a new root class it should implement the NSObject protocol.

You misunderstand.

Everything that I've ever written in ObjC (and that dates back to StepStone/DOS work in the 80's) inherits from Object
or a subclass of Object. I can't really see what use there would be otherwise. NOT inheriting from Object means that
you have NO isa pointer and so no accessible dispatch table. How you gonna send a message to Foo ?

NSObject protocol .... AHA, now this makes sense !!!! Thanks, I will look into that.

-----------------------------------------------
bisk ~ OSX.2.4
G4 PowerMac Gigabit, Dual 500
Sony SDM-M81 18.1" LCD display
1GB, 40GB, SuperDrive(DVR 105)
HP "All-in-One" d135 BubbleJet
-----------------------------------------------
_______________________________________________
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.

References: 
 >Re: What's with these redundant methods ? (From: Chris Hanson <email@hidden>)

  • Prev by Date: [MEETING] Chicago CAWUG Tuesday, April 29th
  • Next by Date: Re: What's with these redundant methods ?
  • Previous by thread: Re: What's with these redundant methods ?
  • Next by thread: Re: What's with these redundant methods ?
  • Index(es):
    • Date
    • Thread