【发布时间】:2009-08-17 23:33:04
【问题描述】:
我正在尝试制作一个在插入时会响应您的命令的应用。因此,您在第一个框中输入任何文本,然后按 Enter。它将在第二个字段中做出响应。我不确定这里的编码是如何完成的。我遇到了“if inputbox text = @”whatever”的问题,我很确定那是完全关闭的。这是我到目前为止的代码(不是 iphone sdk):
#import "HeliosControl.h"
@implementation HeliosControl
- (IBAction)quitButton:(NSButton *)sender {
}
- (IBAction)sendButton:(NSButton *)sender {
if (inputBox *********) // <------ What do I put in for the asterisks?
{
[outputBox setStringValue:@"Welcome to the SYSTEM"];
}
else
{
[outputBox setStringValue:@"I do not understand your command."];
}
}
@end
顺便说一句,自从我一周前开始使用 Objective-C 以来,我完全是个菜鸟。
第二个问题:
这是一个非常简单的方法,但是关闭应用程序的编码是什么?这是我的退出按钮。
【问题讨论】:
标签: objective-c xcode string