(從this thread續)假設我有以下視圖中創建:
「查看」按鈕應該推送新的ViewController其將按Josh或Al顯示所有照片,具體取決於按下哪個按鈕。
我的問題是:
在視圖控制器代碼,我怎麼確定哪些「查看」按鈕被按下(頂部或底部)?
這是代碼,我有:
- (IBAction) viewImageList {
PhotoListViewController* photoListViewController = [[PhotoListViewController alloc]
initWithNibName:@"PhotoListViewController"
bundle:[NSBundle mainBundle]];
// here, I want to dynamically pass in the name (Josh or Al) based on which 'View' button is pressed
photoListViewController.ownerName = @"someName";
[[self navigationController] pushViewController:photoListViewController animated:YES];
[photoListViewController release];
}
或者,如果任何人有不同的方法,我想聽聽吧:)