我有一个类管理两个视图之间的转换。
在第一个视图中,我有一个章节表,在第二个视图中,我有每章的文本。现在,由于我的 sqLite 表是 chapter(id,title,text) 我想将单击的章节的 id 传递给第二个视图,以便在第二个视图中查询表并对章节的正确文本进行排序。
这是我的代码:
void GoToView( UIViewController *from, UIViewController *to){
/*
* Preparo l'animazione e aggiungo la subview.
*/
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:from.view cache:YES];
[from.view addSubview:to.view];
[UIView commitAnimations];
}
例如,如果我单击“第一章”,如何传递“1”?