views:

13

answers:

1

I'm trying to get a value from an object in my mac application. The title says it all.

+1  A: 

NSControl, of which NSTextField is a subclass, has a method intValue, which gets you what you want. Set up an outlet in your controller and use Interface Builder to hook it up to the text field you care about. After that, your controller can just access it like:

int myInt = [myTextField intValue];

The outlet declaration would look something like:

IBOutlet NSTextField *myTextField;

Along with your controller's other instance variables.

Carl Norum
Thank-you so much! :)
samuel
This Objective-C is very different from my normal Lua.
samuel