应用程序未进入快速枚举循环

时间:2010-01-14 05:47:33

标签: iphone objective-c loops fast-enumeration

经过多次调试后,我确定这段代码忽略了快速枚举循环并盲目跳到最后:

-(void)loadOutAnnotations
{
    NSLog(@"entering Annotation enumeration Loop");

    iProspectFresno_LiteAppDelegate *appDelegate =(iProspectFresno_LiteAppDelegate *)[[UIApplication sharedApplication] delegate];

    FlipsideViewController *viewController = (FlipsideViewController *)[[UIApplication sharedApplication] delegate];

    CLLocationCoordinate2D workingCoordinate;
    NSLog(@"initializing");
    NSMutableArray* mines = [[NSMutableArray alloc] initWithArray(NSMutableArray *)appDelegate.mines];
    for (id mine in mines)
    {
        NSLog(@"in the loop");
        //rest of loop code
   }
}

控制台打印“输入注释枚举循环”以及“初始化”,但它似乎完全绕过枚举循环,因为它不是“在循环中”打印。我做错了什么?

1 个答案:

答案 0 :(得分:1)

您确定appDelegate.mines不是空的吗?