Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Fearless Leader

macrumors 68020
Original poster
Mar 21, 2006
2,360
0
Hoosiertown
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

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-
 
You will need to post more code (and errors, if any). Hard to tell what's going on. Also make sure you don't have a 2nd copy of the view being initialized unnecessarily.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.