2013-09-22 4 views
0

나는 현재 두 ViewControllers (2 .h, .m.xib 파일)을 가지고 있고 버튼을 누를 때를 전환하려면 (즉 옵션 버튼을 클릭합니다.)
enter image description here enter image description here enter image description hereViewControllers를 어떻게 전환합니까?

내가 노력하고있어 화면을 Options.xib 파일로 전환 할 수 있지만이를 수행하는 방법을 잘 모르겠습니다. 합니다 (.pngs 그냥 발사 이미지입니다.) 나는 매우 (전체 코드 주시면 감사하겠습니다.) 오브젝티브 C에 경험이 아니에요 감사합니다 :)

답변

1
#import "OptionViewController.h" 


- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 
    [optionsButton addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside]; 
} 

- (IBAction)buttonPressed:(id)sender 
{ 
    OptionViewController *vc = [[OptionViewController alloc] initWithNibName:nil bundle:nil]; 
    [self presentViewController:vc animated:YES completion:^(void){}]; 
} 
+0

이 파일은 어떤 파일입니까? – blustone

+0

이것은 화면에있는 뷰 컨트롤러에 대한 구현 파일 (.m 파일)에 들어가야하며이 작업을 연결할 단추가 들어 있습니다. 버튼에 액션을 첨부하는 코드도 필요합니다 (내 대답 편집). – bneely

+0

단추를 optionsButton – blustone

0

Options View Controller에있는 버튼에서 Ctrl dragmodal를 선택했다.

관련 문제