Possible Duplicate:
How can I check if a UILabel's value is more than 0 in an if statement?爲什麼我的UILabel不能識別「isEqualToString:」?
爲什麼下面的代碼不工作?
if([Period2 isEqualToString:@"PSHEEC"])
{
NSLog(@"TEST");
}
我收到此錯誤:
2011-12-02 08:45:52.579 iDHSB[7605:707] -[UILabel isEqualToString:]: unrecognized selector sent to instance 0x4884c50 2011-12-02 08:45:52.581 iDHSB[7605:707] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UILabel isEqualToString:]: unrecognized selector sent to instance 0x4884c50' * First throw call stack: (0x323e28bf 0x35cfa1e5 0x323e5acb 0x323e4945 0x3233f680 0x3152b191 0x9c905 0x316cf871 0x323e5814 0x323407e1 0x323403ff 0x34767e5b 0x323e4ab3 0x3233f680 0x323e5814 0x323407e1 0x33dcb43d 0x33dde8dd 0x323b6b03 0x323b62cf 0x323b5075 0x323384d5 0x3233839d 0x378b7439 0x315558e1 0x2d77 0x27c0) terminate called throwing an exception[Switching to process 7171 thread 0x1c03] (gdb)
打印的間隔2的值,你可以檢查該串是否正確與否 – Tendulkar