Re: creating a new object with a decendant class from EOGenericRecord
Re: creating a new object with a decendant class from EOGenericRecord
- Subject: Re: creating a new object with a decendant class from EOGenericRecord
- From: Chuck Hill <email@hidden>
- Date: Thu, 06 Jan 2005 15:05:07 -0800
What, precisely, does "goes in the tank" entail? Is there an exception?
Does it have a name? Does it have an address (is there a stack trace)?
Sounds like something is not getting built into the app. Using wretchCode?
Probably added the class to the wrong target.
IMHO, the "best practice" way of creating a new instance is
MTSubscriber user = (MTSubscriber)
EOUtilities.createAndInsertInstance(editingContext, "MTSubscriber");
Chuck
At 01:23 PM 06/01/2005 -0600, John Spicer wrote:
>>>>
I have created an EOModler class and given it a name (MTSubscriber). I've
created the class file for it and added it to the project.
I need to create one in the code. I'm trying this:
MTSubscriber user = (MTSubscriber) new MTSubscriber();
this compiles and runs, but when I get to that line the app goes in the tank.
I've also tried this but I get a class cast exception at run time (make
sense, since user is declared as MTSubscriber instead of EOGenericRecord):
subscriberDescription =
EOClassDescription.classDescriptionForEntityName("MTSubscriber");
user = (MTSubscriber) new EOGenericRecord (subscriberDescription);
I'm trying to model it after chapter 10 of the Web Applications book (page
150-151).
I know I'm missing something basic here. Sorry I have to ask.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
.net
This email sent to email@hidden<<<<
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden