bluetooth99 2013-04-23 02:17 采纳率: 0%
浏览 1827
已采纳

iphone中传递注释到数组

传递自定义注释到NSMutableArray,用来充填tableView中。代码:

在.h文件中定义了一个NSMutableArray *mapViewAnnotations;

然后在.m文件中:

- (void)plotBarPosition:(NSString *)datos{

/*
code that extract data froma a json string
*/
    MyLocation *nota =[[MyLocation alloc] initWithName:barNamePlusDistance coordinate:coordinate horario:horario oferta:offerta more:info];        
                NSLog(@"nota    :%@",nota);

            [_mapView addAnnotation:nota];   //annotation are  plot on  the map

            [mapViewAnnotations addObject:nota];   

            NSLog(@"mapViewAnnotations:%@",mapViewAnnotations);  //NSlog return null
    }

结果mapViewAnnotations 为空。是不是不能将对象复制到mutablearray中?谢谢。

  • 写回答

1条回答

  • xiaoyaokk 2013-04-23 02:38
    关注

    我想知道mapViewAnnotations初始化了没

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作