I am trying to figure out how to add an instance of MKAnnotation to a MKMapView. I can't figure out what I am doing wrong...everything seems to go fine until I actually try and add the annotation to the mapView. Then I receive a SIGABRT error. Here is my code:
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];
Do you have to set the region of the map first or something?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With