去customcell的viewController

我有一个自定义单元格加载的tableview。自定义单元有一个button,点击其中一个select器将打开哪个将有选项可供select。

问题是,modalViewController方法不工作,它给出以下错误。

Selector *sel = [[Selector alloc]initWithNibName:@"Selector" bundle:nil]; [self PresentModalViewController:sel animated:YES]; error:property presentModalViewController not found on object of type CustomCell *...and selector is the pickerview controller class...the method is written in ibaction function in customcell.m file 

v如何调用自定义单元格的其他视图?

谢谢

首先,命名你的class级“select”是一个非常混乱的想法。 你应该使用更具描述性的东西,还有一些不是obj-c关键字的东西。

至于你的问题,我认为你应该使用委托从单元格视图到控制器的引用。 在您的自定义单元格视图类中,执行如下操作:

 @property (nonatomic, assign) id delegate; // implementation @synthesize delegate = _delegate; // in your cell... method [self.delegate presentPicker]; 

在这里,代表伊娃将指向您的视图控制器。 要设置它,find你分配细胞的地方,然后做

 ACell *aCell = [ACell alloc] init]; aCell.delegate = self;