What does the error “unrecognized selector sent to instance” mean in Xcode

后端 未结 10 673
谎友^
谎友^ 2021-01-11 09:28

What does it mean \"unrecognized selector sent to instance\" in Xcode?

10条回答
  •  既然无缘
    2021-01-11 09:52

    I received this error due to not assigning the custom class to the view in the Interface Builder.

     NSArray *subviewArray = [[NSBundle mainBundle] loadNibNamed:@"EventsFilterView" owner:self options:nil];
     self.filters = [subviewArray objectAtIndex:0];
    

    The variable self.filters was assigned to the EventFilterView class but the actual view in the xib file was not.

    Hope this helps someone.

提交回复
热议问题