Xcode 4.6.2 and strange iPhone Simulator issue -
i came across strange iphone simulator issue. have created application uses mkmapview show map. want map centered , therefor used following code.
- (void)viewdidload { [super viewdidload]; cllocationcoordinate2d location; location.latitude = 47.379022; location.longitude = 8.541001; mkcoordinatespan span; span.latitudedelta = 0.05; span.longitudedelta = 0.05; mkcoordinateregion region; region.center = location; region.span = span; [self.mapview setmaptype:mkmaptypestandard]; [self.mapview setregion:region animated:yes]; }
this code works flawless in fresh "hellomap" xcode project , should - centering map on zurich.
but using exact same code in project puts map somewhere near antarctica. have tried clean building environment using "product" -> "clean"... no changes.
also deleting app emulated iphone doesn't make change. used terminal check , remove remaining apps corresponding folder.
it seems changes made xcode project not (always) getting transferred iphone simulator. e.g mkmapview loads when source code above commented out...
i running out of ideas here... input?
[edit]
resetting whole simulator going "ios-simulator" -> "inhalte und einstellungen zurücksetzen" made work once (!!) ...
[edit]
this seems runtime issue. putting code above "- (void)viewdidappear:(bool)animated" makes behave correctly - @ least almost. user sees animated fly "default location" coordinates.
where need put code map @ right position when view loaded?
i using viewwillappear , had same problem, use suggestion viewdidappear , problem solve.
Comments
Post a Comment