• 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: Casting one Custom EO Class into Another...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Casting one Custom EO Class into Another...


  • Subject: Re: Casting one Custom EO Class into Another...
  • From: Owen McKerrow <email@hidden>
  • Date: Thu, 23 Dec 2004 09:43:08 +1100

Why not write a little for loop that does the conversion by hand ?

NSMutableArray masters = .... ;//get master from DB with fetch spec.

for ( i=0;i<masters.count();i++ )
{
InventoryMaster tempMaster = (InventoryMaster)masters.objectAtIndex(i);
eCommerce tempComm = (eCommerce )EOUtiliies.createAndInsertInstance(ec,"eCommerce");

//For all the attributes of InventoryMaster
tempComm.takeValuesFromDictionary(tempMaster.snapshot());
}


I have no idea if the above code works, but I belive it should, if ALL the attribues and rleationships names are exactly the same.

Owen

On 23/12/2004, at 8:53 AM, Clint Fleetwood wrote:

I need to cast say InventoryMaster class (a custom EO class from the eomodel, table called InventoryMaster) into another class called eCommerceBucket (another custom EO class from the eomodel) in order to save the data from InventoryMaster to eCommerceBucket...The two tables contain the EXACT SAME database structure (same attributes and fields and everything), the eCommerceBucket is a temporary store to hold some temporary data before passing it off to another company to be used for an online website. I am putting the results from a fetchSpec called against InventoryMaster into an NSMutableArray and I need to put that data into eCommerceBucket but it complains that it can't because the datatype is of type InventoryMaster and NOT eCommerceBucket.

Can Somebody please help....VERY DESPERATE.....THANKS A MILLION !!

_______________________________________________
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


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

"I like the way this project has somehow, against all common sense, got itself made."
- Peter Jackson, "The Lord of The Rings"


_______________________________________________
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


References: 
 >Casting one Custom EO Class into Another... (From: Clint Fleetwood <email@hidden>)

  • Prev by Date: Casting one Custom EO Class into Another...
  • Next by Date: Re: [SOLVED] dev runs fine - server gives errors
  • Previous by thread: Casting one Custom EO Class into Another...
  • Next by thread: Re: Casting one Custom EO Class into Another...
  • Index(es):
    • Date
    • Thread