I'm new to working with the gui, usually only terminal, so If I'm hard to follow I'm sorry.
I'm trying to store the points from a click into a MutableArray, each time I click I add a point to it. When I click down The log message i placed within my
it correctly displays the point within the window, however when I go to add the point to the array it doesn't look like its accessing the one the was initialized at startup, and nothing gets added. No instance variables can be accessed with code inside mouseDown.
However If i make the code respond to a button click or something along those lines it can access the instance variables and thus the array. I cant seem to figure out what is going on here. If someone knows where to look in the documentation to help me that would be great because I've looked allover. Or if someone knew of a simple example of how cocoa and mouse events work together correctly that would also be great.
Thank you,
-FL-
I'm trying to store the points from a click into a MutableArray, each time I click I add a point to it. When I click down The log message i placed within my
Code:
-(void)mouseDown:(NSEvent*)theEvent
{
}
it correctly displays the point within the window, however when I go to add the point to the array it doesn't look like its accessing the one the was initialized at startup, and nothing gets added. No instance variables can be accessed with code inside mouseDown.
However If i make the code respond to a button click or something along those lines it can access the instance variables and thus the array. I cant seem to figure out what is going on here. If someone knows where to look in the documentation to help me that would be great because I've looked allover. Or if someone knew of a simple example of how cocoa and mouse events work together correctly that would also be great.
Thank you,
-FL-