【发布时间】:2011-11-02 22:24:00
【问题描述】:
我试图弄清楚如何将 MKAnnotation 的实例添加到 MKMapView。我无法弄清楚我做错了什么......在我真正尝试将注释添加到mapView之前,一切似乎都很好。然后我收到一个 SIGABRT 错误。这是我的代码:
lon = [[attributeDict objectForKey:@"long"] doubleValue];
lat = [[attributeDict objectForKey:@"lat"] doubleValue];
MKPointAnnotation *point;
CLLocation *theLocation = [[CLLocation alloc]initWithLatitude:lat longitude:lon];
CLLocationCoordinate2D location;
location.latitude = lat;
location.longitude = lon;
[point setCoordinate:(location)];
[point setTitle:businessName];
//ITS RIGHT HERE THAT I GET THE ERROR
[theMap addAnnotation:point];
你必须先设置地图的区域还是什么?
【问题讨论】:
标签: ios objective-c ios4 mapkit