Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 如何将某些代码中的int值设置为等于文本输入框中的值?_Objective C_Macos_Int - Fatal编程技术网

Objective c 如何将某些代码中的int值设置为等于文本输入框中的值?

Objective c 如何将某些代码中的int值设置为等于文本输入框中的值?,objective-c,macos,int,Objective C,Macos,Int,我正在尝试从mac应用程序中的对象获取值。NSControl,其中NSTextField是一个子类,它有一个方法intValue,可以得到您想要的。在控制器中设置一个插座,并使用Interface Builder将其连接到您关心的文本字段。之后,您的控制器可以像这样访问它: int myInt = [myTextField intValue]; 出口声明类似于: IBOutlet NSTextField *myTextField; 以及控制器的其他实例变量。此Objective-C与我的普通

我正在尝试从mac应用程序中的对象获取值。

NSControl
,其中
NSTextField
是一个子类,它有一个方法
intValue
,可以得到您想要的。在控制器中设置一个插座,并使用Interface Builder将其连接到您关心的文本字段。之后,您的控制器可以像这样访问它:

int myInt = [myTextField intValue];
出口声明类似于:

IBOutlet NSTextField *myTextField;

以及控制器的其他实例变量。

此Objective-C与我的普通Lua非常不同。