我想將自定義註釋傳遞給NSMutableArra以便使用它來填充表視圖。 的代碼是:iphone將註釋傳遞給數組
在.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導致空。 Perarps無法將MyLocation對象複製到可變陣列中?
在此先感謝。
似乎你從來沒有初始化你的NSMutableArray.It默認情況下有一個空值。 – FreeNickname 2013-04-22 18:56:35
http://stackoverflow.com/questions/6410798/annotation-on-the-map-problem/6411217#6411217 – rptwsthi 2013-04-22 18:58:05