iphone - 如果带有文本框的语句不工作

  显示原文与译文双语对照的内容
0 0

我有五个文本框,它们是在触摸时从 array 中循环值的子类。 它们都是空白的。

如果框收到 @"u2714" 值,我想用n/a 自动填充其他值。

我已经尝试了dosent在接收 @"u2714" 时改变了文本框的值。 不确定我在这里做了什么错误?

这是我的nsarray: //self.valuesArray = [NSArray arrayWithObjects:@"u2714", @"X", @"LIM", @"N/A", nil];

如果将字符串设置为 array 中的任何值,则文本框不会用 N/A 填充。 如果将 isEqualToString:sting 设置为 @"",则可以将文本框值设置为 N/A,但不会基于通过 array的任何输入。


 self.tncsTapView.textValue = ([self attributeWithName:@"systemTypeTncs"]).value;
 if ([self.tncsTapView.textValue isEqualToString:@"X"]){
 self.tncTapView.textValue = @"N/A";
 self.tnsTapView.textValue = @"N/A";
 self.itTapView.textValue = @"N/A";
 self.ttTapView.textValue = @"N/A";
 }
 self.tnsTapView.textValue = ([self attributeWithName:@"systemTypeTns"]).value;
 if ([self.tnsTapView.textValue isEqualToString:@""]){
 self.tncsTapView.textValue = @"N/A";
 self.tncTapView.textValue = @"N/A";
 self.itTapView.textValue = @"N/A";
 self.ttTapView.textValue = @"N/A";
 }
 self.tncTapView.textValue = ([self attributeWithName:@"systemTypeTnc"]).value;
 if ([self.tncTapView.textValue isEqualToString:@""]){
 self.tncsTapView.textValue = @"N/A";
 self.tnsTapView.textValue = @"N/A";
 self.itTapView.textValue = @"N/A";
 self.ttTapView.textValue = @"N/A";
 }

 self.itTapView.textValue = ([self attributeWithName:@"systemTypeIt"]).value;
 if ([self.itTapView.textValue isEqualToString:@""]){
 self.tncTapView.textValue = @"N/A";
 self.tnsTapView.textValue = @"N/A";
 self.tncsTapView.textValue = @"N/A";
 self.ttTapView.textValue = @"N/A";
 }

 self.ttTapView.textValue = ([self attributeWithName:@"systemTypeTt"]).value;
 if ([self.ttTapView.textValue isEqualToString:@""]){
 self.ttTapView.textValue = @"N/A";
 self.tnsTapView.textValue = @"N/A";
 self.itTapView.textValue = @"N/A";
 self.tncsTapView.textValue = @"N/A";
 }




 self.tncsTapView.textValue = ([self attributeWithName:@"systemTypeTncs"]).value;
 if ([self.tncsTapView.textValue isEqualToString:@"u2714"]){
 self.tncTapView.textValue = @"N/A";
 self.tnsTapView.textValue = @"N/A";
 self.itTapView.textValue = @"N/A";
 self.ttTapView.textValue = @"N/A";
 }
 self.tnsTapView.textValue = ([self attributeWithName:@"systemTypeTns"]).value;
 if ([self.tnsTapView.textValue isEqualToString:@"u2714"]){
 self.tncsTapView.textValue = @"N/A";
 self.tncTapView.textValue = @"N/A";
 self.itTapView.textValue = @"N/A";
 self.ttTapView.textValue = @"N/A";
 }
 self.tncTapView.textValue = ([self attributeWithName:@"systemTypeTnc"]).value;
 if ([self.tncTapView.textValue isEqualToString:@"u2714"]){
 self.tncsTapView.textValue = @"N/A";
 self.tnsTapView.textValue = @"N/A";
 self.itTapView.textValue = @"N/A";
 self.ttTapView.textValue = @"N/A";
 }

 self.itTapView.textValue = ([self attributeWithName:@"systemTypeIt"]).value;
 if ([self.itTapView.textValue isEqualToString:@"u2714"]){
 self.tncTapView.textValue = @"N/A";
 self.tnsTapView.textValue = @"N/A";
 self.tncsTapView.textValue = @"N/A";
 self.ttTapView.textValue = @"N/A";
 }

 self.ttTapView.textValue = ([self attributeWithName:@"systemTypeTt"]).value;
 if ([self.ttTapView.textValue isEqualToString:@"u2714"]){
 self.ttTapView.textValue = @"N/A";
 self.tnsTapView.textValue = @"N/A";
 self.itTapView.textValue = @"N/A";
 self.tncsTapView.textValue = @"N/A";
 }

时间: 原作者:

0 0

在NSString中的反斜杠由两个连续的反斜杠表示。 在所有的if语句中,尝试以下操作:


if ([self.tncsTapView.textValue isEqualToString:@"u2714"])

原作者:
0 0

试试吧


self.tncsTapView.text = [self attributeWithName:@"systemTypeTncs"];

 if ([self.tncsTapView.text hasPrefix:@"u2714"])
 {
 }

原作者:
0 0

我想你必须在任何地方移除价值。 指定时,将它的指定为文本,同时在检查时也将它的作为文本进行检查。


self.tncsTapView.text = [self attributeWithName:@"systemTypeTncs"];
if ([self.tncsTapView.text isEqualToString:@"u2714"]){
self.tncTapView.text = @"N/A";
self.tnsTapView.text = @"N/A";
self.itTapView.text = @"N/A";
self.ttTapView.text = @"N/A";
}
self.tnsTapView.text = [self attributeWithName:@"systemTypeTns"];
if ([self.tnsTapView.text isEqualToString:@"u2714"]){
self.tncsTapView.text = @"N/A";
self.tncTapView.text = @"N/A";
self.itTapView.text = @"N/A";
self.ttTapView.text = @"N/A";
}
self.tncTapView.text = [self attributeWithName:@"systemTypeTnc"];
if ([self.tncTapView.text isEqualToString:@"u2714"]){
self.tncsTapView.text = @"N/A";
self.tnsTapView.text = @"N/A";
self.itTapView.text = @"N/A";
self.ttTapView.text = @"N/A";
}

self.itTapView.text = [self attributeWithName:@"systemTypeIt"];
if ([self.itTapView.text isEqualToString:@"u2714"]){
self.tncTapView.text = @"N/A";
self.tnsTapView.text = @"N/A";
self.tncsTapView.text = @"N/A";
self.ttTapView.text = @"N/A";
}

self.ttTapView.text = [self attributeWithName:@"systemTypeTt"];
if ([self.ttTapView.text isEqualToString:@"u2714"]){
self.ttTapView.text = @"N/A";
self.tnsTapView.text = @"N/A";
self.itTapView.text = @"N/A";
self.tncsTapView.text = @"N/A";
}

原作者:
...