• 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: Question for the Java Gurus
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question for the Java Gurus


  • Subject: Re: Question for the Java Gurus
  • From: Art Isbell <email@hidden>
  • Date: Wed, 21 Apr 2004 18:17:44 -1000

On Apr 21, 2004, at 5:48 PM, Owen McKerrow wrote:

How can I make the following code work if entity is an instance of String passed in as an argument to the function. i.e. Can I cast to a specific Class if all I have is the name of the Class as a String ? If not is there another way I can do this ?

public getOtherObjects(String entity, NSArray objects) {

	for(int i=0;i<objects.count();i++) {
		Object tempOb = (entity)array.objectAtIndex(0);
	}
}

Not sure what you're trying to do since the above function really does nothing. If objects is an array of enterprise objects, then you can assign an array element to a variable of type EOEnterpriseObject:


EOEnterpriseObject tempOb = (EOEnterpriseObject)objects.objectAtIndex(0);

Aloha,
Art
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: SOLVED Question for the Java Gurus
      • From: Owen McKerrow <email@hidden>
References: 
 >Question for the Java Gurus (From: Owen McKerrow <email@hidden>)

  • Prev by Date: Re: WO and Java 'packages'?
  • Next by Date: Re: WO and Java 'packages'?
  • Previous by thread: Question for the Java Gurus
  • Next by thread: Re: SOLVED Question for the Java Gurus
  • Index(es):
    • Date
    • Thread