我无法访问ViewController的这个方法

时间:2012-01-16 20:23:00

标签: ios nsnotifications

这是所选复选框的结果,我需要访问该方法以阻止所有其他复选框。

我收到了这个错误:

-[UIView removeTarget]: unrecognized selector sent to instance 0x6aeded0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:'-[UIView removeTarget]:
unrecognized selector sent to instance 0x6aeded0'

-(void)checked:(NSNotification *)notif {
    for (int i = 0; i < [[[[[[[[[self.view.subviews objectAtIndex:2] subviews] objectAtIndex:2] subviews] objectAtIndex:1] subviews] objectAtIndex:4]subviews] count]; i++) 
    {
        AskViewController *askView = ((AskViewController *)[[[[[[[[[self.view.subviews objectAtIndex:2] subviews] objectAtIndex:2] subviews] objectAtIndex:0] subviews] objectAtIndex:4]subviews] objectAtIndex:i]);
        [askView removeTarget];
    }

}

1 个答案:

答案 0 :(得分:0)

您正在尝试对不支持该方法的对象(UIView)执行removeTarget。