Issues with Inheritance and collections?
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