passing NSImage between views in separate windows

I have an NSView subclass that contains an NSImage and I want to pass the NSImage from the NSView subclass to another NSView subclass contained in another window.

Here is some sample code

       --get the image from the first subclass
    set tView to view "myView" of window "imageViewer"
    set tImage to call method "image" of tView --breaks at this point

in the class it is a simple

-(NSImage *)image { return image; }
Can this not be done from ASS?

Having got the image I want to

set tGeometryView to view "geometryView" of scroll view "geometryView" of window "geometryWindow"
call method "setImage:" of tGeometryView with parameter tImage

again this is a simple cocoa method

-(void)setImage:(NSImage *)newImage { [newImage retain]; [image release]; image = newImage; [self adjustFrame]; }
I have it working with a path but I simpley want to transfer the image pointer.

Any ideas please

Best Regards

Terry

I seem to have got an answer.

I have declared another class called viewController and the following method:



+(void)transferImageFrom:(myView *)myView toView:(IGEditView *)igEditView
{
	[igEditView setImage:[myView image]];
}

I then call it as follows from ASS


set tView to view "myView" of window "imageViewer"

set tGeometryView to view "geometryView" of scroll view "geometryView" of window "geometryWindow"

call method "transferImageFrom:toView:" of class "viewController" with parameters {tView, tGeometryView}

This seems to work.

If anyone has a simpler method then please let me know.

All the best

Terry