2013-06-18 4 views
0

내 앱의 이상한 충돌 문제가 있습니다. 일단 ViewController에서 B ViewController를 입력하면 충돌이 발생합니다 (매번 발생하지는 않습니다). 여기에 코드iOS 6의 PresentViewController 충돌

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    NSUInteger row = [indexPath row]; 
    NSUInteger section = [indexPath section]; 

    if(section == 0 && row == 0 && self.uidString && self.profileDic) 
    { 
      BViewController *bviewcontroller = [[BViewController alloc] init]; 
      [bviewcontroller setProfileDic:self.profileDic]; 
      bviewcontroller.delegate = self; 
      bviewcontroller.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; 
      [self presentModalViewController:bviewcontroller animated:YES]; 
      [bviewcontroller release]; 
    } 
} 

이며 충돌 로그 내가 답을 보면서 여기에 몇 가지 게시물의 UIViewController의 "presentViewController"방법은 아이폰 OS 4.3과 솔루션을 사용할 수 없습니다 때문입니다 말했다

Date/Time:  2013-06-18 10:00:39.720 +0800 
OS Version:  iOS 6.1.4 (10B350) 
Report Version: 104 

Exception Type: EXC_CRASH (SIGABRT) 
Exception Codes: 0x0000000000000000, 0x0000000000000000 
Crashed Thread: 0 

Last Exception Backtrace: 
0 CoreFoundation     0x31d3c3e2 __exceptionPreprocess + 158 
1 libobjc.A.dylib     0x39a3795e objc_exception_throw + 26 
2 CoreFoundation     0x31d3c298 +[NSException raise:format:arguments:] + 96 
3 Foundation      0x32612f9e -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 86 
4 UIKit       0x33c37754 -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:] + 172 
5 UIKit       0x33c36fa6 -[UIViewController presentViewController:withTransition:completion:] + 3394 
6 UIKit       0x33d58d9e -[UIViewController presentModalViewController:animated:] + 26 

입니다 "presentViewController"를 "presentModalViewController"로 변경하는 것입니다. 그러나 이것이 바로 내가 작성한 코드입니다. 어떤 일이 일어날 지 아는 사람이 있습니까? 미리 감사드립니다.

+0

코드 구현을 게시 할 수 있습니까? – MrBr

+0

안녕하세요, MrBr, 방금 코드를 게시합니다. –

답변

1

제시된보기 컨트롤러를 어딘가에 유지해야 할 수도 있습니다 (예 : iVar). 그것이 나타나기 전에 그것이 할당 해제되고있는 것 같아요.

+0

안녕하세요 frasmage, 나는 ARC를 사용하지 않았지만 위의 소스 코드에서 나는 그것이 나타나기 전에 할당이 해제되었다고 생각하지 않습니다. (그리고 내가 언급했듯이,이 충돌은 단지 한 번 발생한다) –