0

您好,感谢您的帮助

为什么这个 for 循环没有被调用。(内容是一个 nsmutableArray)

 NSString *setBiz = [[NSString alloc]init];
setBiz = @"MomAndPop";
 NSLog(@"??????????listby???????????%@\n",setBiz);


for (NSDictionary *key in self.contents) {
    NSLog(@"hi inside loopppp");  //I never see this ????????

     NSString *c = [key objectForKey:@"BizName"];
    NSString *string = [NSString stringWithFormat:@"%@", key];  //random test 


    if ([c isEqualToString:setBiz]) {
        NSLog(@"gotch you");
    }

}
4

1 回答 1

3

最可能的答案是其中self.contents没有元素。

将其放在循环之前以输出循环中的元素数:

NSLog(@"self.contents.count: %lu", self.contents.count);

于 2012-12-30T21:36:12.607 回答