Re: Question for the Java Gurus
Re: Question for the Java Gurus
- Subject: Re: Question for the Java Gurus
- From: Jake MacMullin <email@hidden>
- Date: Thu, 22 Apr 2004 15:03:16 +1000
Is this what you're looking for?
public getOtherObjects(String entity, NSArray objects) {
for(int i=0;i<objects.count();i++) {
Object tempOb = (Class.forName(entity))array.objectAtIndex(0);
}
}
Regards,
Jake MacMullin
On 22 Apr 2004, at 1:48 PM, Owen McKerrow wrote:
Hi All,
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);
}
}
Thanks
Owen McKerrow
"As of tomorrow, employees will only be able to access the building
using individual security cards. Pictures will be taken next Wednesday
employees will receive their cards in two weeks."
- "Dilbert Quotes" Winner, Fred Dales, Microsoft Corp
_______________________________________________
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.
_______________________________________________
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.