Unrecognized selector sent to instance

后端 未结 3 1965
遥遥无期
遥遥无期 2020-12-21 09:36

Anyone know why I am getting this error?

Terminating app due to uncaught exception \'NSInvalidArgumentException\', reason: \'-[CustomRaisedTabViewController          


        
3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-21 10:14

    action: @selector(cancel:) 
    

    For the action selector which takes parameter! cancel: that means which will take another parameter.

    change your method to

    -(IBAction)cancel:(id)sender{
    // Do wat you want
    }
    
    or
    
    -(IBAction)cancel:(UIButton *)btnSender{
    /// Do what you want
    }
    

提交回复
热议问题