我有一个班级名称是searchresultviewcontroller
另一个customcell
班级是searchresultcell
在该班级中我有一个UIButton
,当点击该按钮时会导航到其他班级类。参与的自定义单元xib
图片
// for .h file
@class SearchResultViewController;
@interface searchresultcellCell : UITableViewCell{
IBOutlet UIButton *btnReadMore;
SearchResultViewController *parent;
}
@property(nonatomic,retain)SearchResultViewController *parent;
@property(nonatomic,retain)IBOutlet UIButton *btnReadMore;
-(IBAction)btnMore:(id)sender;
// .m file
-(void)btnMore:(id)sender{
NSLog(@"Sucess");
AboutViewController *objAbout = [[AboutViewController alloc]initWithNibName:@"AboutViewController" bundle:Nil ];
[parent.navigationController pushViewController:objAbout animated:YES];
}
答案 0 :(得分:1)
它不会通过parentiew控制器选项解决
您可以使用两个选项