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

发布于 2024-08-18 12:25:20 字数 739 浏览 7 评论 0原文

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

-(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
   }
}

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

after much debugging, I have determined that this code is ignoring the fast enumeration loop and blindly jumping to the end:

-(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
   }
}

the console prints "entering Annotation enumeration Loop" as well as the "initializing," but it seems to bypass the enumeration loop completely, as it is not printing "in the loop." what am I doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

唯憾梦倾城 2024-08-25 12:25:20

您确定appDelegate.mines不为空吗?

Are you sure appDelegate.mines is not empty?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文