다음은 시나리오입니다. 내 iPhone 앱 (OS 3.1.2)에서 pushViewController 호출을 사용하여 "보기 2"로 탐색하는 "보기 1"이 있습니다. 그런 다음 "보기 2"에서 사용자는 선택적으로 "보기 3"을 호출 할 수 있습니다.이보기는 presentModalViewController와 애니메이션 (수평 전환 뒤집기)을 사용하여 표시됩니다. 보기 1 < ->보기 2를 아무런 문제없이 앞뒤로 전환 할 수 있습니다. 하지만보기 1 ->보기 2 -보기 3, 나는보기 2로 돌아갈 수 있습니다 (보기 3에서 적절한 dismissModalViewControllerAnimated 호출로). 보기 2에서 한 번보기 1로 돌아가는 것은 "표준"objc_msgSend 오류로 응용 프로그램을 중단시킵니다. 내가보기 2보기 1 탐색 방법은 다음과pushViewController와 presentModalViewController를 결합 할 때 objc_msgSend로 iPhone 응용 프로그램이 깨졌습니다.
는 다음과 같습니다
여기NewsArticleController *articleViewController = [[NewsArticleController alloc] initWithNibName:@"NewsView" bundle:nil news:f1Data];
articleViewController.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:articleViewController animated:YES];
[articleViewController release];
내가보기 3보기 2에서 이동하는 방법은 다음과 같습니다
addFeedController = [[AddFeedViewController alloc] initWithNibName:@"AddFeedView" bundle:nil];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:addFeedController];
[addFeedController release];
navigationController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[[self navigationController] presentModalViewController:navigationController animated:YES];
[navigationController release];
여기보기 3 일축가보기로 돌아 가야하는 방법 2 :
- (IBAction)cancel
{
[self dismissModalViewControllerAnimated:YES];
}
그리고 마지막으로, 스택 추적 :
#0 0x96a8aedb in objc_msgSend
#1 0x04859550 in ??
#2 0x01c26908 in CFRelease
#3 0x01c49869 in __CFDictionaryDeallocate
#4 0x01c26a41 in _CFRelease
#5 0x00043cf5 in NSPopAutoreleasePool
#6 0x035f7858 in run_animation_callbacks
#7 0x035f75f5 in CA::timer_callback
#8 0x01c67ac0 in CFRunLoopRunSpecific
#9 0x01c66c48 in CFRunLoopRunInMode
#10 0x0245378d in GSEventRunModal
#11 0x02453852 in GSEventRun
#12 0x002d3003 in UIApplicationMain
#13 0x000023b0 in main at main.m:5
어쩌면 나는 장님이며 여기에 오류가 표시되지 않지만 실제로 붙어 있습니다. 도와주세요! 당신의 -cancel
액션 메소드에 대한
이렇게하면 코드가 컴파일되어 제대로 실행되지만 "취소"단추는 더 이상 아무것도 수행하지 않습니다 (아무 것도 닫히지 않음). 어쨌든 다른 것 일 테지만 고마워. – Romain
그건 이상합니다. 아마도 NSZombie를보고 지나치게 많은 시간을 보냈거나 객체를 일찍 릴리스했는지 확인하십시오. –