Tom*_*oda 5 macos cocoa objective-c
我是可可的新手.我创建项目,我有一个textField和一个按钮.我为按钮创建功能,我开始其他功能,没关系.但我需要从textField获取数值作为我的函数的参数...像这样:
@implementation AppController
- (IBAction)StartReconstruction:(id)sender {
int RecLine = //here i need something like textField1.GetIntValue();
drawGL(RecLine);
}
@end
Run Code Online (Sandbox Code Playgroud)
在IB中我只创建数字格式文本字段.但我不知道如何从代码中调用它:(
感谢帮助
您应该能够执行以下操作:
int RecLine = [textField1.text intValue];
Run Code Online (Sandbox Code Playgroud)
这是假设您的 textField1 有可以转换为整数的内容。
归档时间: |
|
查看次数: |
15510 次 |
最近记录: |