When I run this code in device release mode, it pulls a "SIGABRT" on the "[mapView setRegion:region animated:TRUE];" line. However, I don't get the problem in either debug or simulator mode.
I'm a novice in xcode. What am I doing wrong?
- (void)initUI {
// add a map view in available area
startupPage = [[CSNet alloc] init];
positionUpdatePage = [[CSNet alloc] init];
opponentsPage = [[CSNet alloc] init];
firePage = [[CSNet alloc] init];
checkinPage = [[CSNet alloc] init];
[self getStartup:FALSE];
UIImage *blueButton = [[UIImage imageNamed:@"blueButton.png"] stretchableImageWithLeftCapWidth:12.0f topCapHeight:0.0f];
UIImage *redButton = [[UIImage imageNamed:@"redButton.png"] stretchableImageWithLeftCapWidth:12.0f topCapHeight:0.0f];
UIImage *gpsImage = [UIImage imageNamed:@"gps_icon.png"];
[self initSounds];
[gpsButton setBackgroundImage:gpsImage forState:UIControlStateNormal];
[settingsButton setBackgroundImage:blueButton forState:UIControlStateNormal];
[joinButton setBackgroundImage:blueButton forState:UIControlStateNormal];
[fireButton setBackgroundImage:redButton forState:UIControlStateNormal];
[self UpdateIndicators];
MKCoordinateRegion region;
region.span.latitudeDelta = [appDelegate.savedSpanLatitude floatValue];
region.center.latitude = [appDelegate.savedLatitude floatValue];
region.center.longitude = [appDelegate.savedLongitude floatValue];
mapHeight = self.view.frame.size.height; // - 50;
mapView = [[MKMapView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, mapHeight)];
// viewtouch catches events on map
viewTouch = [[CSViewTouch alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, mapHeight)];
viewTouch.multipleTouchEnabled = TRUE;
[self.view insertSubview:mapView atIndex:0];
[mapView setDelegate:self];
mapType.selectedSegmentIndex = [appDelegate.savedMapViewType intValue];
[mapView setRegion:region animated:TRUE];