Re: Question for the Java Gurus
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.