我正在iOS上使用位置服务开发IPS。我用storyboard来设计我的viewControllers。单击导航视图控制器(使用iphonelocation服务显示当前位置)时出现问题。无论我想从导航视图控制器转到哪一页(主视图控制器,约会视图控制器等),整个应用程序崩溃。希望寻求帮助解决这个问题,在尝试3天后完全失去了。
// MenuViewController.m
@implementation MenuViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[self.slidingViewController setAnchorRightRevealAmount:280.0f];
self.slidingViewController.underLeftWidthLayout = ECFullWidth;
}
-(void)goToPage:(NSString*) page
{
UIViewController *newTopViewController = [self.storyboard instantiateViewControllerWithIdentifier:page];
[self.navigationController pushViewController:newTopViewController animated:YES];
[self.slidingViewController anchorTopViewOffScreenTo:ECRight animations:nil onComplete:^{
CGRect frame = self.slidingViewController.topViewController.view.frame;
self.slidingViewController.topViewController = newTopViewController;
self.slidingViewController.topViewController.view.frame = frame;
[self.slidingViewController resetTopView];
}];
}
- (IBAction)goToMainMenu:(id)sender
{
[self goToPage:@"MenuMain"];
}
- (IBAction)goToAppointment:(id)sender
{
[self goToPage:@"Appointment"];
}
- (IBAction)goToFindADoctor:(id)sender
{
[self goToPage:@"FindADoctor"];
}
- (IBAction)goToNavigation:(id)sender
{
[self goToPage:@"Navigation"];
}
- (IBAction)goToViewQueue:(id)sender
{
[self goToPage:@"ViewQueue"];
}
@end
错误追踪:
ibobjc.A.dylib`objc_msgSend:
0x177a08c: movl 8(%esp), %ecx
0x177a090: movl 4(%esp), %eax
0x177a094: testl %eax, %eax
0x177a096: je 0x177a0e8 ; objc_msgSend + 92
0x177a098: movl (%eax), %edx
0x177a09a: pushl %edi
0x177a09b: movl 8(%edx), %edi
0x177a09e: pushl %esi ******* Error msg (Thread 1 Exc_bad_access (code=1,address=01x7412ab...)
0x177a09f: movl (%edi), %esi
0x177a0a1: movl %ecx, %edx
0x177a0a3: shrl $2, %edx
0x177a0a6: andl %esi, %edx
0x177a0a8: movl 8(%edi,%edx,4), %eax
0x177a0ac: testl %eax, %eax
0x177a0ae: je 0x177a0b9 ; objc_msgSend + 45
0x177a0b0: cmpl (%eax), %ecx
0x177a0b2: je 0x177a0d0 ; objc_msgSend + 68
0x177a0b4: addl $1, %edx
0x177a0b7: jmp 0x177a0a6 ; objc_msgSend + 26
0x177a0b9: popl %esi
0x177a0ba: popl