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