Skip to main content

Posts

Showing posts with the label mapkit

Unrecognized selector sent to instance?

I have seen that a few others have had this problem as well. I'm trying to follow a tutorial online that shows how to create animated pins on a MapView. I have implemented the code as shown in the tutorial and the project builds fine except I receive this exception: -[MKPointAnnotation iconN]: unrecognized selector sent to instance I have a subclass of 'MKPinAnnotationView' and in the .m file I create this method: - (void)setAnnotation:(id<MKAnnotation>)annotation { [super setAnnotation:annotation]; //Place *place = [[Place alloc] init]; Place *place = (Place *)annotation; //The following line is where the program sends "SIGABRT" icon = [UIImage imageNamed:[NSString stringWithFormat:@"pin_%d.png", [place.iconN intValue]]]; [iconView setImage:icon]; } Here are a few parts from my "model" which is called Place.h/.m. Here is where I create the property for 'iconN'. @property (retain, nonatomic) NSNumbe

MKMapKit Hexagon or Square Overlay

I want to make overlay with hexagon or squares over google map with MKMapKit. Not just one hexagon or square, i want to use google map like a tile based map with full overlay with hexagons in every 1km area. I know app will crash if i do the overlay in one process so i want to do it only on the viewable portion of the screen but in that case i have difficulties to make the distance from the start point, its not getting on the right point or hexagons are not same size everywhere etc. My question: lets think i have 1 thousand hexagons in the viewable portion, so what is the best way to place them with a equal distance at once, how should my calculation ? if i scroll the map, how should i calculate the new start points. or should i give up from hexagon and use another think ? i hope i give you a clue for what i have try to do, any helps, any examples or any ideas are welcome.