Possible Duplicate:
How to compare strings? ( ==
returns wrong value)
我有以下代码,但是什么也没有发生,这是为什么?:
if(Assignment1DueDate.text == @"0 days until due"){
[Assignment1DueDate setText:@"Due tomorrow"];
[maincelltext addObject:Assignment1.text];
[subtitlecelltext removeObject:Assignment1DueDate.text];
[subtitlecelltext addObject:Assignment1DueDate.text];
}
最佳答案
if([Assignment1DueDate.text isEqualToString:@"0 days until due"]){
// do your stuff
}
关于iphone - 如何检查UILabel中的文本? ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7964086/