#744: map on an array delivered by terminal app via scripting bridge gives an immutable error ----------------------------+----------------------------------------------- Reporter: jazz...@… | Owner: lsansone...@… Type: defect | Status: closed Priority: major | Milestone: MacRuby 0.7 Component: MacRuby | Resolution: invalid Keywords: | ----------------------------+----------------------------------------------- Changes (by martinlagarde...@…):
* status: new => closed * resolution: => invalid Comment: I'm not sure how it worked in MacRuby 0.5. Are you sure it does work? Doesn't work with my copy of 0.5. In fact, it doesn't work in Obj-C either, so I'm not really sure how we can make it work within MacRuby :P {{{ #!text/x-objc #import <Foundation/Foundation.h> #import <ScriptingBridge/ScriptingBridge.h> int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; SBApplication *app = [SBApplication applicationWithBundleIdentifier:@"com.apple.terminal"]; SBElementArray *windows = [app windows]; NSLog(@"%@", [windows class]); // This raises "can't add an object that already exists" [windows addObject:@"Window name"]; int i = 0; for (id termWindow in windows) { // Same for that [windows replaceObjectAtIndex:i++ withObject:[termWindow name]]; } [pool drain]; return 0; }}} I'm closing the bug right now, bug feel free to re-open the bug if you have an Obj-C version that modifies the array that I would not have thought of. -- Ticket URL: <http://www.macruby.org/trac/ticket/744#comment:1> MacRuby <http://macruby.org/> _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel