我正在使用 iOS 上的位置服务开发 IPS。我使用故事板来设计我的视图控制器。当我单击导航视图控制器(使用 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