我正在尝试设置一个 NSMutablearray,但总是得到空值,它不会在迭代中更新为不同的值。这是代码:
NSMutableString *tipo = [NSMutableString stringWithString:@""];
if (self.canas.on){
[tipo stringByAppendingString: @"0"];
}
if (self.copas.on){
if ([tipo length]==0){
[tipo stringByAppendingString: @"1"];
}else{
[tipo stringByAppendingString:@",1"];
}
}
if (self.comer.on){
if ([tipo length]==0){
[tipo stringByAppendingString: @"2"];
}else{
[tipo stringByAppendingString:@",2"];
}
}
非常感谢