Note that there are some explanatory texts on larger screens.

plurals
  1. POLooking up address using mapkit and searchbar
    primarykey
    data
    text
    <p>I am trying to make an app similar to the Maps of the iPhone. I want to use the Mapkit and a searchbar to look up an address. And then use the address to add it to my tableview But I have actually no idea how to do this. Does someone have a clue for me? A tutorial or an example?</p> <p>thanks in advance</p> <p>======================</p> <p>Right now I am able to search for the address with out a table. but I want to make it possible that when I press on a pin it will have a button on the annotation. I am using this code, but as you can see there is a NSLog, but it doesn't come up in my console:</p> <pre><code>- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id &lt;MKAnnotation&gt;)annotation{ NSLog(@"This is called"); MKPinAnnotationView *annView=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"customloc"]; [annView setPinColor:MKPinAnnotationColorPurple]; UIButton *button = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; [button addTarget:self action:@selector(goDetail:) forControlEvents:UIControlEventTouchUpInside]; annView.leftCalloutAccessoryView = button; annView.canShowCallout = YES; [annView setSelected:YES]; [annView addObserver:self forKeyPath:@"selected" options:NSKeyValueObservingOptionNew context:nil]; return annView; } </code></pre> <p>also, when I open up my mapview. I get a pin on my current location, but for some reason my current location changes and a new pin was set on the map. I just want the current location pin on it and one pin of my selected location can someone help me? this is my code:</p> <pre><code>-(void)addPins:(float)lat lon:(float)lon{ CLLocationCoordinate2D location; location.latitude = lat; location.longitude = lon; // forcus around you MKCoordinateRegion region; region.center=location; MKCoordinateSpan span; span.latitudeDelta=0.005f; // this should be adjusted for high vs. low latitude - calc by cosign or sign span.longitudeDelta=0.005f; region.span=span; [map setRegion:region animated:TRUE]; // add custom place mark CustomPlacemark *placemark=[[[CustomPlacemark alloc] initWithCoordinate:location] autorelease]; placemark.title = @""; placemark.subtitle = @""; [map addAnnotation:placemark]; [placemark release]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload