我正在做一个应用程序,该应用程序包含一个包含MKMapView
要转到的应用程序,没关系,但是当我想再次加载应用程序崩溃时,它不会给出任何错误,只是崩溃并显示它崩溃的机器代码,但它首先说:然后是很多机器代码。back button
UIView
MKMapView
main menu
UIView
MKMapView
com.apple.CoreLocation.ConnectionClient.0x1e5d5220
崩溃报告在这里:
我必须补充一点,我第一次加载UIView
它是100% 工作的。
谢谢你的帮助。
PS:为什么这么说dealloc?
是因为我认为做类似的事情dealloc
可能会解决我的问题,并且与第一次运行相同。
EDIT1:
我的- (void) viewDidLoad;
方法。
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *response = [self sendPostToURL: @"http://hidden.php"
withPost: @"hidden"];
[self tratarXML: response];
yo = @"Posición actual";
self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
self.locationManager.distanceFilter = kCLDistanceFilterNone;
[self.mapView setDelegate: self];
[self.mapView setZoomEnabled: NO];
[self.mapView setScrollEnabled: NO];
if ([CLLocationManager locationServicesEnabled])
{
self.locationManager.delegate = self;
self.mapView.showsUserLocation = YES;
[self.mapView setMapType: MKMapTypeStandard];
[self.mapView setUserTrackingMode: MKUserTrackingModeFollowWithHeading animated: NO];
[self.locationManager startUpdatingLocation];
//[self.locationManager startUpdatingHeading];
self.mapView.userLocation.title = yo;
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
message:@"Debe activar la localización en esta aplicación para funcionar"
delegate:self
cancelButtonTitle:@"Aceptar"
otherButtonTitles:nil, nil];
[alert show];
}
}
EDIT2: 我的后退按钮代码:
- (IBAction) iniciar: (id)sender
{
if ([iniciar.title isEqualToString:@"Volver"])
{
menuViewController *obj = [[menuViewController alloc] initWithNibName:@"menuViewController" bundle:nil withUser:user];
[self presentViewController:obj animated:YES completion:nil];
}
else
{
// censored
}
我正在使用简单的 *.xib 导航器,而不是情节提要等...
EDIT3:
加载菜单按钮MKMapView UIView
- (IBAction) TEST: (id)sender
{
mapaViewController *obj = [[mapaViewController alloc] initWithNibName: @"mapaViewController" bundle: nil withUser: user];
[self presentViewController:obj animated:YES completion:nil];
}