[partially solved]: com.webobjects.foundation.NSMutableArray.addObject("anString");

Strausz Riccardo <[email protected]> Wed, 3 Sep 2003 04:14:57 -0500
Newsgroups gmane.comp.web.webobjects.eof
Message-ID <[email protected]>
Well, a dirty solution again...
problem:
it seem that the probles is with the bridge; since I am calling the 
keys.addObject("aKey"); from ObjC (with [keys addObject:@"aKey"];), the 
bridge is serching for a method with signature
com.webobjects.foundation.NSMutableArray.addObject(String aString);
which does not exists.
sol.:
implement a Util.java which does the job in the Java side... quite 
dirty!!!
I am trying to cast my strings to id (Object) to fool the bridge, but 
have not yes a clean solution...
If some one else finds a better solution, please let me know.
Dino

On lunes, sept 1, 2003, at 13:34 America/Mexico_City, Ricardo Strausz 
wrote:

> I am getting crazy with this... please help.
> It may be just as simple, but it looks like I am blind about it.
>
> The scenario: I am inserting a new object in a DisplayGroup which 
> takes its values from another one which alredy exists (in another 
> DisplayGroup). I am using an NSDictionary as a "transport" object for 
> the values. The code is below.
>
> The error is: com.webobjects.foundation.NSMutableArray does not 
> responds to addObject()
> which is obviously not true!!!!
>
> Am I doing something wrong?
> or, do I have to blame the Bridge??
>
> - (IBAction)add:(id)sender
> {
>     EODisplayGroup* dgDetallesP; //  asume this exists (it lives in 
> the nib)
>     EODisplayGroup* dgDetallesF; //  asume this exists (it lives in 
> the nib)
>     NSArray* source = [dgDetallesP selectedObjects];
>     NSEnumerator* enSource = [source objectEnumerator];
>     EOGenericRecord* eo = nil;
>
>     while([enSource hasMoreElements]){
>         eo = [enSource nextElement];
>
>         NSMutableArray* keys = 
> [NSClassFromString(@"com.webobjects.foundation.NSMutableArray") new];
>         [keys addObject:@"cantidad"];
>         [keys addObject:@"descripcion"];
>         NSDictionary* nsd = [eo valuesForKeys:keys];
>
>         [dgDetallesF insert:self];
>         EOGenericRecord* neo = [dgDetallesF selectedObject];
>         [neo takeValuesFromDictionary:nsd];
>     }
> }
>
>
> Dino
> http://homepage.mac.com/strausz