我是iPhone Developer的新手。導航到iPhone上的按鈕點擊新頁面
我想要做的導航與動畫新的頁面,但我無法導航到新的頁面,
這裏是我的代碼片段,
UIButton *Planbtn = (UIButton *)[self.view viewWithTag:1];
[Planbtn addTarget:self action:@selector(btnClicked) forControlEvents:UIControlEventTouchUpInside];
..
-(void)btnClicked{
NSLog(@"btnClicked");
PlanPage *yourViewController = [[PlanPage alloc] initWithNibName:@"PlanPage" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:yourViewController animated:TRUE];
[yourViewController release];
}
我可以在我的日誌中看到。
在此先感謝!
你需要將btnClicked鏈接到你的界面事件插座 –
發佈一些更多的細節,你是否也實現了'UINavigationController'? –
我想你鏈接你的iBoutlet,如果你看到NSLog。所以也許你的navigationController是零,因爲沒有初始化。 – Valerio