segue 호출 준비시 오류 메시지없이 충돌이 계속 발생합니다. 그래서 NSLog를 사용하여 무슨 일이 일어나고 있는지 추적합니다. 다음 줄은 여기 isKindOfClass 비교시 segue crashing 준비
NSLog(@"The VCs matched!!: ")
에 도달하지 내가 추천 할 수있는 모든 스토리 보드 편집기에서 뷰 컨트롤러의 클래스를 지정하는 것이있는 정보를 제공하는 방법
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
NSLog(@"enter prepare for segue.");
NSIndexPath *indexPath = [self.tableView indexPathForCell:sender];
if ([segue.identifier isEqualToString:SegueIdentifierA]) {
NSLog(@"Destination to match are: %@, %@ .",segue.destinationViewController,[PaperDetailViewController class]);
if ([segue.destinationViewController isKindOfClass:[PaperDetailViewController class]]) {
NSLog(@"The VCs matched!!: ");
PaperDetailViewController *paperDetailView = (PaperDetailViewController *)segue.destinationViewController;
}else NSLog(@"NO ONO NO match for %@ AND %@.",segue.destinationViewController,[PaperDetailViewController class]);
}
NSLog(@"exit prepare for segue.");
}
디버거에 표시되는 스택 추적을 추가 할 수 있습니까? –
첫 번째 NSLog ("일치하는 대상"@)에 도달 했습니까? 중단 점을 설정하고 디버거에서 단계별로 실행하면 충돌하는 정확한 행을 식별하여 도움이됩니다. – WillyCornbread
도달하지 못한 첫 번째 로깅 라인은 지정한 것입니다. 다른 모든 로깅 라인은 지정한 것입니다. – learner