【发布时间】:2012-05-20 13:42:38
【问题描述】:
我正在尝试设置一个 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"];
}
}
非常感谢
【问题讨论】:
标签: objective-c nsmutablestring