我有一个班级名称是searchresultviewcontroller
另一个customcell
班级searchresultcell
在那个班级我有一个UIButton
当点击那个按钮时将导航到另一个班级。一个 atteched customcellxib
图像
// 对于 .h 文件
@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];
}