¡@

Home 

2014/10/15 ¤U¤È 10:13:48

iphone Programming Glossary: self.map

Drag an annotation pin on a mapview

http://stackoverflow.com/questions/10733564/drag-an-annotation-pin-on-a-mapview

CGPoint dropPoint CGPointMake annotationView.center.x annotationView.center.y CLLocationCoordinate2D newCoordinate self.mapView convertPoint dropPoint toCoordinateFromView annotationView.superview annotationView.annotation setCoordinate newCoordinate.. After that you just have to use your annotation like this Assuming you have imported MyAnnotation.h and you have a self.map property pointing to a MKMapView MyAnnotation myPin MyAnnotation alloc initWithCoordinate self.map.centerCoordinate Or whatever.. and you have a self.map property pointing to a MKMapView MyAnnotation myPin MyAnnotation alloc initWithCoordinate self.map.centerCoordinate Or whatever coordinates... self.map addAnnotation myPin Also you have to return a view for your annotation...

HowTo initialise MKMapView with a given user location?

http://stackoverflow.com/questions/1437568/howto-initialise-mkmapview-with-a-given-user-location

of the blue marble annotation yourself. To let the mapview's own userLocation do the updating add to viewDidLoad self.map.userLocation addObserver self forKeyPath @ location options NSKeyValueObservingOptionNew NSKeyValueObservingOptionOld context.. addObserver self forKeyPath @ location options NSKeyValueObservingOptionNew NSKeyValueObservingOptionOld context NULL self.map.showsUserLocation YES starts updating user location Implement observeValueForKeyPath . It gets called when the location.. void observeValueForKeyPath NSString keyPath ofObject id object change NSDictionary change context void context if self.map isUserLocationVisible self.locationManager stopUpdatingLocation self.ownBlueMarble.hidden YES The current location is in..

how to call pin annotation on button click in iphone

http://stackoverflow.com/questions/6058939/how-to-call-pin-annotation-on-button-click-in-iphone

mapView MKMapView mapView viewForAnnotation id MKAnnotation annotation MKPinAnnotationView pin MKPinAnnotationView self.map dequeueReusableAnnotationViewWithIdentifier @ restMap if pin nil pin MKPinAnnotationView alloc initWithAnnotation annotation..

How to safely shut down a loading UIWebView in viewWillDisappear?

http://stackoverflow.com/questions/789984/how-to-safely-shut-down-a-loading-uiwebview-in-viewwilldisappear

if the user hits the back button before it's loaded . In my viewWillDisappear handler I have this map.delegate nil self.map stopLoading this seems to handle most cases OK as nil'ing the delegate stops it sending the didFailLoadWithError to my view..