Saturday, 15 September 2012

iphone - place pin on mapview by coordinates sent from appdelegate -


It takes me a day .. I could not do it. I write a method which shows a pin on the map below Keeps:

  - (zero) Setmaps: (NSString *) Lets: (NSString *) Launches; {If ([upLo isEqualToString: @ "Y"]) {NSLog (@ "setting maps:% @,% @", lathes, lawns); [MapView SetMetty type: MKMapTypeStandard]; [See the map Setzum is enabled: Yes]; [MapViewSetcroll is enabled: Yes]; [MapView SetMetty type: MKMapTypeStandard]; [See the map Setzum is enabled: Yes]; A [mapView set ScrollEnabled: Yes]; MKCoordinateRegion field = {{0.0, 0.0}, {0.0, 0.0}}; Region.center.latitude = [dual value]; Region.center.longitude = [Lawn double value]; Region.span.longitudeDelta = 0.01f; Region.span.latitudeDelta = 0.01f; [MapView Set Region: Animated Area: Yes]; [MapView Set Delegate: self]; Mkpoint Annotations * Point = [[Mk Point Annotation Elok] Init]; Point.coordinate = region.center; [Add Self Impression Indication: Point]; }}   

This method runs well if I call it in a tab bar control application in the second viewer.

But, I want to call it from appdelegate.m. So in appdelegate.m, I put

  secondViewController * Gper = [[secondViewController alloc] init]; [Gapper setmaps: lat: LOON]; [Gear release]; From the NSLog (@ "setting maps:% @,% @", let's, lawns)   

; I can see that the value of latitude and loan is correct in this method. However, the map does not change at this place.

What should I do to show this new location?

Thanks for any help

I think you can do something else First learn (Objective-) C Memory Management and Conferences of Cocoa give a new example of your view controller class, and is not currently displayed.

And start with the name of your class with a capital letter and your method name with lowercase.

No comments:

Post a Comment