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

gomezman78

macrumors newbie
Original poster
Dec 24, 2010
1
0
I'm sorry if this is a simple question but I cannot find an answer anywhere and I've been working on this problem for a couple of days now.

Basically, what I am trying to do is create a program where the user will input a value into a NSTextField, click a button, and that value will become a coordinate value for a point in a NSView.

Everything I have tried automatically draws the point before the user even inputs any information. Is there a good tutorial out there for this problem that I'm not finding? It seems like it would be a pretty simple solution and maybe I've just been staring at the screen too long.

Thanks.
 
Without seeing any code, I can't be certain of a solution, but I can offer some ideas.

First, you say it draws the point before the user enters any information. Well, the big question is, where is your view getting the coordinate values that it's using to draw the point?

Further to this one, where are you initializing this NSPoint(which I'm assuming is where you're holding the coordinate values) Are you initializing it when the program starts, or when the user clicks the aforementioned button? Given that you don't even have a point until the user clicks the button, I don't see any reason for the NSPoint to be initialized during the startup sequence.

I may not be a guru, given that I still ask more questions than I answer, but hopefully that helps.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.