我有五个文本框,它们是子类视图,当被触摸时,它们会循环数组中的值。他们一开始都是空白的。
如果该框收到值@"\u2714"
我想用 N/A 自动填充其他框。
到目前为止,我尝试过的内容会在@"\u2714"
收到时更改文本框的值。不知道我在这里做错了什么?
这是我的nsarray: //self.valuesArray = [NSArray arrayWithObjects:@"\u2714", @"X", @"LIM", @"N/A", nil];
如果我将字符串设置为数组中的任何值,则文本框不会填充 N/A。如果我设置isEqualToString:sting
为@""
我可以让我的文本框值全部默认为 N/A,但不是基于循环遍历数组时的任何输入
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";
}