2013年4月16日 星期二

二種轉換UIViewController的方式

第一種是不需要NavigationController 是一種正反面的概念,由位於正面的viewcontroller發動,把背面的viewcontroller推出來,
 BookWebDetailViewController *bookWebDetailViewController = [[[BookWebDetailViewController alloc] initWithBook:aBook] autorelease];
[self presentModalViewController:bookWebDetailViewController animated:YES]; 
相同的,要把背面的viewcontroller推回去也是由正面的viewcontroller發動
[self dissmissModalViewController:bookWebDetailViewController animated:YES]; 
第二種是要用NavigationController 這是一種stack的概念,把detailview實作好再push出來,可以無限制的push下去,但也要一層一層pop回來

沒有留言:

張貼留言