2012-05-25 2 views
0

내 주 메뉴 (ViewController)는 Xcode4의 스토리 보드에 추가 한 NavigationController에 포함되어 있습니다. 내 메뉴에 새로운보기를 표시하는 버튼이 있습니다. 를 표시하려면 내가 사용IBAction이라는보기에서 탐색 모음이 없습니다.

- (IBAction) display : (id) sender 
{ 
    if(!anotherView) anotherView = [[AnotherView alloc] initWithNibName:@"AnotherView" bundle:nil]; 
    [self presentModalViewController:anotherView animated:NO]; 
} 

내 다른보기는 정확하게 모든 개체와 요소가 표시됩니다. 내 NavigationController의 막대를 제외하면 나타나지 않습니다. 왜 ? 당신의 조언

답변

1

[self presentModalViewController:anotherView animated:NO]; 

당신은 당신이 아마

[self.navigationController pushViewController:anotherView animated:YES] 
당신이 정말로 혼합되지 뭘 원하는지 물론

이었다 무엇을 의미하는지보기 modally을 제시하는 대신 스토리 보드와 비 스토리 보드 흐름이 불필요하게 일치하고 sto가 있습니다. ryboard이 작업을 수행하십시오

+0

이 조언에 대해 감사드립니다. – Rob

1

에 대한

덕분에 당신은 모달 당신의 ViewController을 제시하고 있습니다. 탐색 컨트롤러를 사용하려면 탐색 스택에보기를 밀어 넣어야합니다.

[self.navigationController pushViewController:anotherViewController animated:YES]; 
+0

대단히 감사합니다! – Rob

0

탐색 표시 줄을 잃지 않고 계속 모달로 표시 할 수 있습니다. 다음 코드를 사용해보십시오.

AnotherView *tempAnotherView = [[AnotherView alloc] initWithNibName:@"AnotherView" bundle:nil]; 
[self setAnotherView:tempAnotherView]; 
[tempAnotherView release]; 

UINavigationController *navController = [[[UINavigationController alloc] initWithRootViewController:self.anotherView] autorelease]; 
[self.navigationController presentModalViewController:navController animated:YES]; 

희망이 있습니다. :)

관련 문제