사용자가 위치 공유를 허용 한 후에보기를 표시하려고합니다. 여기에 코드입니다 :[__NSCFNumber isEqualToString :] : 인스턴스로 전송 된 인식 할 수없는 선택 자
-(void) locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status {
if (status == kCLAuthorizationStatusDenied) {
NSLog(@"Denied");
}
else if (status == kCLAuthorizationStatusAuthorized) {
NSLog(@"Accepted!");
AlertViewController *aViewController = [[AlertViewController alloc] initWithNibName:@"AlertViewController" bundle:nil];
aViewController.view.frame = CGRectMake(0, 0, 320, 460);
aViewController.view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate.window addSubview:[aViewController view]];
}
}
하지만 라인 aViewController.view.frame = ...
내가 중단 점을 넣어 aViewController
가 alloc
문 후 0x00000
없는 것을 확인에 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber isEqualToString:]: unrecognized selector sent to instance 0xee6fc90'
오류가 발생합니다. 나는 그 문제가 무엇인지 알아낼 수 없다. 해결책을 제안하십시오.
응용 프로그램이 충돌하는 원인은 무엇입니까? – Morion
'aViewController.view.frame = CGRectMake (0, 0, 320, 460); ' – ddd
그 오류를 일으킬 수있는 것 같지 않습니다. 그걸 밟을 때 실제로 충돌합니까? – paulmelnikow