What does the error "unrecognized selector sent to instance" mean in Xcode -


What it means "sent to unrecognized selector for example" in Xcode < / Code>?

This means that the method is not defined or on the other side, on which a method is calling the wrong object .

The classic example of this error is missing from ':' in the selector's call.

  UIBarButtonItem * doneBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemDone Target: Self-action: @selector (DatePickerDoneClick)];   

here,

  verb: @selector (DatePickerDoneClick :)   

is expected

  Actions: @selector (DatePickerDoneClick)    

Comments