In my iPad app, I have created a UIBarbuttonItem to facilitate the emailing feature for user. But somehow on clicking the UIBarButtonItem, following error messages thrown by the application in xcode.
unrecognized selector sent to instance
This kind of error occurs, when the given "selector action" is not named properly.
UIBarButtonItem *emailButton = [[UIBarButtonItem alloc] initWithTitle:@"Email" style:UIBarButtonItemStylePlain target:self action:@selector(xyz:)];
action:@selector(xyz:) So, here action name must be same to the button action method.