嗯,这是我的代码:isEqualToString误会我的意思结果
AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
NSLog(@"Row %i at View: %@",indexPath.row, [delegate.my_condition objectAtIndex:indexPath.row]);
if ([@"0" isEqualToString:[delegate.my_condition objectAtIndex:indexPath.row]]){
NSLog(@"Store is closed");
} else {
NSLog(@"Store is open");
,并在日志中我看到:
2012-08-29 22:33:59.434 MyApp[2593:c07] Row 0 at View: 0
2012-08-29 22:33:59.435 MyApp[2593:c07] Store is open
2012-08-29 22:33:59.437 MyApp[2593:c07] Row 1 at View: 0
2012-08-29 22:33:59.438 MyApp[2593:c07] Store is open
2012-08-29 22:33:59.440 MyApp[2593:c07] Row 2 at View: 0
2012-08-29 22:33:59.441 MyApp[2593:c07] Store is open
我确实认为这个值是0,但我没有看到,如果子句,但是else子句。
这是为什么?
myCondition is NSMutableArray
这是我如何将项目添加到我的NSMutableArray:
NSString *parsed=[res objectForKey:@"Data"];
[delegate.my_condition addObject:parsed];
myCondition中有哪些类型的对象? –