Re: Casting Object to NSArray
Re: Casting Object to NSArray
- Subject: Re: Casting Object to NSArray
- From: Goodbye Bill <email@hidden>
- Date: Fri, 27 Jun 2003 22:35:08 -0400
Thanks for all of the replies, however I left out one small detail that will
probably change all of your answers: this is via a web service.
The code on the SERVER (the WebService) looks like this...
private NSArray myObjects;
public NSArray GetObjects()
{
return myObjects;
}
The code on the CLIENT (the consumer app) looks like this...
public NSArray myReceivedObjects()
{
Object tmpArray = serviceClient().invoke(serviceName(),
"GetObjects", null);
return (NSArray)tmpArray;
}
Here's a little more info on this:
1. The "serviceClient" is a "WOWebServiceClient" object;
2. According to the API Reference, the "invoke" method on this object
returns an "Object" regardless of what method it invokes on the server.
The client example above will compile but generates a "ClassCastException"
exception at runtime.
Any ideas? I'm going on two full days working with this. The bottom line
is that I need to get an array of objects from a web service.
Thanks. =(
On 6/27/03 3:40 PM, "Goodbye Bill" <email@hidden> wrote:
> There is a method (not mine) that I am calling from my code which passes
> back an "Object" and does this for EVERYTHING it returns (only one public
> method). The "Object" that I am trying to receive from it is actually an
> "NSArray" however I cannot figure out the syntax to get the generic "Object"
> object back to an "NSArray" object.
>
> Any ideas?
> _______________________________________________
> 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.