我有按鈕page 1
當我點擊按鈕我正在執行一些動畫和導航到新頁面說Page 2
。UIButton點擊崩潰的應用程序
在page 2
有取消按鈕,當我點擊,我想回到我的先行頁面,即Page 1
,但點擊取消按鈕我的應用程序崩潰。
這裏是Page 1:
名稱頁CRViewController的是對Page 2:
頁RegistraionViewController的名稱
- (IBAction)ClickMe:(id)sender {
RegistraionViewController *secondController = [[RegistraionViewController alloc] init];
CATransition *transitionAnimation = [CATransition animation];
[transitionAnimation setDuration:1];
[transitionAnimation setType:@"push"];
[transitionAnimation setSubtype:kCATransitionFromBottom];
[transitionAnimation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]];
[self.view.layer addAnimation:transitionAnimation forKey:kCATransitionFromBottom];
[self.view addSubview:secondController.view];
}
代碼我的示例代碼(在其崩潰的點擊。)
- (IBAction)Click:(id)sender {
CRViewController *secondController = [[CRViewController alloc] init];
CATransition *transitionAnimation = [CATransition animation];
[transitionAnimation setDuration:1];
[transitionAnimation setType:@"push"];
[transitionAnimation setSubtype:kCATransitionFromTop];
[transitionAnimation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]];
[self.view.layer addAnimation:transitionAnimation forKey:kCATransitionFromBottom];
[self.view addSubview:secondController.view];
}
當應用程序崩潰時,是否有任何錯誤信息? – dandan78
@Krunal:顯示如何創建取消按鈕。 – TamilKing
不,它只在我的日誌中顯示'lldb' – Krunal