• 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
Inheriting a problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Inheriting a problem


  • Subject: Inheriting a problem
  • From: "Mike O'Connor" <email@hidden>
  • Date: Mon, 06 Jan 2003 20:04:47 -0500

This is probably a newbie question as I am relatively new to Cocoa but an example of the problem I'm getting is: Say I have a class UpperClass and a class that inherits from it, LowerClass. LowerClass has a method LowerMethod I want to call, but the object I have says it is an UpperClass. So if I try to call LowerMethod on it, I get an error that it does not recognize the selector.

I tried casting it [(LowerClass*)theObject LowerMethod] but this doesn't work. I also tried assigning the pointer to it to a pointer defined as LowerClass but the dubugger shows it "isa" UpperClass and I get the same error. Is there something else I should try? I believe my object really is a LowerClass, but the system is passing it as an UpperClass - unless I must be wrong about that? TIA
_______________________________________________
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: Inheriting a problem
      • From: Greg Titus <email@hidden>
  • Prev by Date: Re: NSBitmapImageRep with indexed 8bit source data
  • Next by Date: Re: Inheriting a problem
  • Previous by thread: Re: Setting an NSMenuItem icon with iconForFile leads to slow menus?
  • Next by thread: Re: Inheriting a problem
  • Index(es):
    • Date
    • Thread