1.用UINavigationController的時(shí)候用pushViewController:animated
----返回之前的視圖[[self navigationController] popViewControllerAnimated:YES];
---ps:push以后會(huì)在navigation的left bar自動(dòng)添加back按鈕,它的響應(yīng)方法就是返回。所以一般不需要寫返回方法,點(diǎn)back按鈕即可。
2.其他時(shí)候用presentModalViewController:animated
[self presentModalViewController:controller?animated:YES];//YES有動(dòng)畫效果
-----返回之前的視圖??? [self?dismissModalViewControllerAnimated:YES];