problem about mkannotation-Collection of common programming errors


  • iOS Developer
    iphone ios mkannotation callouts currentlocation
    I am using custom call out (title and subtitle)for Current location icon. I tried following to disable default annotation but it does not work.- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation {NSLog(@”viewForAnnotation”);if ([annotation isKindOfClass:[MKUserLocation class]]){MKAnnotationView *userLocationView = [mapView viewForAnnotation:annotation];userLocationView.canShowCallout = NO;NSLog(@”[annotation isKindOfClass:[MKUserLocation cla

  • huggie
    ios5 mkmapview mkannotation
    I’m checking the breadcrumb example:http://developer.apple.com/library/ios/#samplecode/Breadcrumb/Introduction/Intro.htmlOn the iphone simulator, if I simulate somewhere off the initial US view from the MKMapView, drawMapRect:zoomScale:inContext: doesn’t get called when it should draw something.Why is that? When is the method called? What can I do to make it work?

  • ajnet
    iphone objective-c xcode4 mkannotation
    I’m following the Nerd Ranch i0S Programming guide. I need to tag map annotations with the dates that they were created. The following method I created overrides the MKAnnotation title property:- (void)setTitle:(NSString *)t {NSDate *today = [NSDate date];NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];// Obtain copy of passed title.[t retain];[title release];// Set required date format.[dateFormatter setDateFormat:@”dd-MM-yyyy”];title = [NSString stringWithFormat:@

  • Benjamin
    iphone webview mkannotation
    I have a problem passing a string to a function that is an web address in order to open that particular direction through a webview.-(IBAction)toWeb:(NSString*)web_direction {UIViewController *webViewController = [[[UIViewController alloc] init] autorelease];UIWebView *uiWebView = [[[UIWebView alloc] initWithFrame: CGRectMake(0,0,320,480)] autorelease];[uiWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:web_direction]]];[webViewController.view addSubview: uiWebView];webView

  • cannyboy
    iphone objective-c ios mkmapview mkannotation
    Using annotations with Map Kit, you can put pins, or even custom images onto the map. Cool.However, the data I’m using has millions of locations, spread out across the world. I don’t want to dump them all on the map, especially since the user is only looking at a small bit of it. It would kill responsiveness, and probably crash.Is there a standard technique for putting these pins on to the map only when required? i.e only when they need to be on the map view (and the immediately surrounding area

  • PSD
    iphone objective-c mkmapview mkannotation iphone-maps
    I am developing a IPhone app based on the map.I need to load thousands of the custom annotations on the map.When the annotation are loaded the app become slow and within 2-3 minutes it crashes.I need solution for managing the loading of the annotation and to solve the memory issue in loading thousands of custom annotations.Need Help.Thanks.

  • Thomas Clayson
    iphone warnings mkannotation
    I have this code:if([annotation respondsToSelector:@selector(tag)]){disclosureButton.tag = [annotation tag]; }and I get the warning:’-tag’ not found in protocolFair enough, but I’ve created a new object with the protocol that has a synthesized int tag variable.EDIT: found why the app was crashing – not this line. Now I just get a warning and the app works fine.Thanks Tom

  • Peter
    iphone ios mkmapview mkannotation mkoverlay
    I want the user to be able to create polygons after placing some (unknown number) MKpointAnnotations in the map.I have put a gesture recognizer that gets activated once the user taps a button, and so annotations are placed.But how to use these as corners for a MKPolygon? Below the code for saving the corners of the polygon.This after some mods I did to it.Now the app crashes and the crash reporter says index out of range.The corners are MKPointAnnotation-s created via a GestureRecognizer.-(IBAct

  • Bryce Thomas
    objective-c mkmapview mkannotation mkplacemark
    I have a MKMapView i’m adding a single MKPlacemark to to represent the location of a building the user has just selected. The user can only select one building at a time, and I simply want to move the placemark to the new building when they select a new building. On the first building they select, it works fine and places a pin on the map. When I try and call setCoordinate on the placemark to update the position of the marker when they select a new building though, I get -[MKPlacemark setCoor

  • Nitish
    iphone mkannotation
    My code for annotation is:- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation {static NSString *identifier = @”RoutePinAnnotation”;if ([annotation isKindOfClass:[UICRouteAnnotation class]]&&[(UICRouteAnnotation *)annotation annotationType] != UICRouteAnnotationTypeWayPoint) {MKPinAnnotationView *pinAnnotation = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:identifier];if(!pinAnnotation) {pinAnnotation = [[[

  • Ganapathy
    objective-c ipad ios6 mkmapview mkannotation
    In my application i have integrated a view controller like container (split view). Controller view controller container two view. Detail view and selection view(table view). While selecting the table cell i need to load the MKAnnotation in MKMap view. It is working fine while tapping the cell normally. If we select the cell from the selection table view simultaneously(randomly selecting the cell faster) application crash. I am sure the crash is due to this Annotation code only. Here is my code.C

  • LouwHopley
    iphone mkmapview mkannotation
    I am working on a simple GPS-like app. I created a custom object which extends MKAnnotation which also works fine. I can place it etc, but if I put this piece of code [mpm setCoordinate:loc]; in my code, the app opens and freezes while showing the basic gray-grid (not showing any downloaded map and non of my buttons work either then)Here is my header:@interface FirstViewController : UIViewController <MKMapViewDelegate> {IBOutlet MKMapView *mapView;MyPlaceMark *mpm; } -(void)locationUpdate:

  • FrustratedCoder
    ios mapkit mkannotation
    I have an Application, which is a SplitViewController that has a master view on the left and the detail view on the right. One of the views (Branch Finder) is a Map view that loads a series of Annotations to the Map.If I let the annotations load before switching to any other view (loading the annotations take takes all of 1 second) then everything is fine. However, if the user quickly switches off the Branch Finder view, whilst the annotations are being loaded, then the App will crash with the f

  • tuzzolotron
    mapkit mkmapview mkannotation mkannotationview
    I’m trying to remove annotaenter code heretion some a MKMapView but am crashing on this line:[self.mapView removeAnnotation:p];p is an object that implements the MKAnnotation protocol and already has an annotation on that map.This is the message I’m getting when I crash:objc[46534]: FREED(id): message release sent to freed object=0x4319640 Program received signal: “EXC_BAD_INSTRUCTION”. (gdb) The backtrace looks like so:(gdb) bt #0 0x951424b4 in _objc_error () #1 0x951424ea in __objc_error ()

  • highlycaffeinated
    iphone crash mapkit mkannotation
    I am storing all the annotations I am adding in a separate array. When I try to remove an annotation that has been added to the mapView using the following code:if(![newClusters containsObject:cluster]){[__mapView removeAnnotations:[__clusterAnnotations objectAtIndex:[__clusters indexOfObject:cluster]]];[__clusterAnnotations removeObjectAtIndex:[__clusters indexOfObject:cluster]];[__clusters removeObject:cluster]; }I get the following error:-[ClusterAnnotationClass countByEnumeratingWithState:ob

  • Jordan Brown
    iphone distance mkannotation mkpinannotationview userlocation
    For some reason whenever i click on my pin the app crashes. there are no errors or warnings in my code. It only happens when i try to get the distance from userLocation to the pin. find my mistake?@implementation FirstViewController // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. – (void)viewDidLoad { mapView.showsUserLocation = YES;[super viewDidLoad]; } -(void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation {

  • Luca
    ios mapkit mkannotation
    when i click on an annotation, it suppose to show me that small window which is not my case, the annotations are here but when i click on one the application throw an exception, and i thought that this code make problems :for (int i=0; i<[array count]; i++) {NSDictionary *stationEnCours=[array objectAtIndex:i];NSString *distance=[stationEnCours objectForKey:@”distance”];float lng = [[stationEnCours objectForKey:@”ssiphone_longitude”] floatValue];float lat = [[stationEnCours objectForKey:@”s

  • Paul Peelen
    iphone asihttprequest iphone-sdk-3.2 mkannotation
    I am experiencing problems using ASIHttpRequst. This is the error I get:2010-04-11 20:47:08.176 citybikesPlus[5885:207] *** -[CALayer rackDone:]: unrecognized selector sent to instance 0x464a890 2010-04-11 20:47:08.176 citybikesPlus[5885:207] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘*** -[CALayer rackDone:]: unrecognized selector sent to instance 0x464a890’ 2010-04-11 20:47:08.176 citybikesPlus[5885:207] Stack: (33936475,2546353417,34318395,33887862,33

  • tjv
    iphone xcode mkannotation userlocation
    I have a MKMap with a series of MKAnnotations, all of which are red which is fine. I have selected “show user location” in IB and to change the MKAnnotation from red to blue, I have the code in my viewForAnnotation method: if (annotation == theMap.userLocation)return nil;All is good and the app works fine, but if the user inadvertently taps the blue userlocation dot I get the following crash:2012-02-01 20:43:47.527 AusReefNSW[27178:11603] -[MKUserLocationView setPinColor:]: unrecognized selecto

  • Dan
    iphone ios ios6 mapkit mkannotation
    My code relevant to the problem:Annotation .h file#import <Foundation/Foundation.h> #import <MapKit/MapKit.h> @interface CityAnnotation : NSObject <MKAnnotation> {NSString *name;NSString *country;CLLocationCoordinate2D coords; }@property (nonatomic,copy) NSString *name; @property (nonatomic,copy) NSString *country; @property (nonatomic,assign) CLLocationCoordinate2D coords;-(id)initWithTitle:(NSString *)cityname AndCountry:(NSString *)countryname AndCoords: (CLLocationCoordi

  • Devin McKaskle
    cocoa-touch mkmapview mkannotation nsmanagedobjectcontext
    I have a subclassed NSManagedObject that conforms to the MKAnnotation protocol and it has NSNumber properties for latitude and longitude.When I change any coordinates myself, I use setCoordinate: and update the latitude and longitude properties inside the implementation of setCoordinate:. Using this method, the map view updates the annotations. However, when I merge changes with another NSManagedObjectContext via mergeChangesFromContextDidSaveNotification:, setCoordinate: is not used because the

  • Eyeball
    iphone ios mkmapview mapkit mkannotation
    I am using ADClusterMapView for annotation clusteringhttps://github.com/applidium/ADClusterMapViewand i have been trying for a VERY long time now to manipulate the files in order to be able to update the subtitle of my annotations. I would like to change it whenever userLocation changes, so i implemented this:-(void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation {for(MapViewAnnotation *annotation in self.mapView.annotations){CLLocation *targetLocation = [[

  • Rich
    iphone annotations mapkit mkannotation mkannotationview
    I’m trying to implement the mapView:annotationView:calloutAccessoryControlTapped: method in my iPhone app. The method is getting called, but when I try to use the view passed to itAnnotation* temp = (Annotation *)view.annotation;the app crashes with the error.2011-03-29 12:51:54.453 Flora[3316:207] * Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[UITouchesEvent annotation]: unrecognized selector sent to instance 0x6d13410’In the debugger, it seems as if the v

  • rokimoki
    ios google-maps mkmapview mkannotation mkannotationview
    Hi everyone I hope you can help me:- (IBAction) addPoints: (id) sender { NSArray *latitudePoints; NSArray *longitudePoints; BOOL flag = NO; @try { switch (lugar) {case 0:break;case 1:latitudePoints = @[@27.781361, @27.777894, @27.766683, @27.757066, @27.745613, @27.737327, @27.728247, @27.720827, @27.720866, @27.719083, @27.722266, @27.721097, @27.739263, @27.758177, @27.780688];longitudePoints = @[@-15.714188, @-15.720175, @-15.726072, @-15.740874, @-15.746066, @-15.759544, @-15.763944, @-15.77

  • terry lewis
    iphone ios mkmapview mkannotation abaddressbook
    So I am using the map to add points for each person that has an address in the contacts, and I am having a bit of a hard time figuring out how to set it up for the unknown number of contacts. right now the way I have it set up, it is only adding a pin for the last contact in the list. here is some code: address is a string that is set from addressProperty.if(addressProperty != nil){[location geocodeAddressString:address completionHandler:^(NSArray *placemarks, NSError *error) {NSMutableArray *ar

Web site is in building