• 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
Issues with Inheritance and collections?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issues with Inheritance and collections?


  • Subject: Issues with Inheritance and collections?
  • From: Devraj Mukherjee <email@hidden>
  • Date: Fri, 30 Jan 2009 22:23:40 +1100

Hi all,

I have two classes DomainLogicBase and Vehicle where Vehicle inherits
from DomainLogicBase (there are other classes in the project that
inherit from DomainLogicBase), DomainLogicBase has some helper
functions that all my models use and it also has some common vars like
UID that all my models inherit.

I am adding objects of type Vehicle to an NSMutableArray which are
read up from disk from an SQLite database.

When I try and get the object back out of the NSMutableArray and
access its properties my app crashes. I have tried to use the debugger
and the best I can tell is the properties seem to have invalid values.

If the model class does not inherit from a custom class I have defined
then the app works fine.

Is there something I am missing? Does inheritance do funny things when
I am adding objects of the children class to a collection?

Any input is welcome. Thanks.

--
"The secret impresses no-one, the trick you use it for is everything"
- Alfred Borden (The Prestiege)
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Issues with Inheritance and collections?
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Finding Thai Words
  • Next by Date: How to find whether the file exists on Hard disk or othe mounted devices?
  • Previous by thread: Finding Thai Words
  • Next by thread: Re: Issues with Inheritance and collections?
  • Index(es):
    • Date
    • Thread