Did you try using UIBarButtonSystemItemCancel
instead of UIBarButtonItemStylePlain
in the style of your UIBarButtonItem
?
Try this,
UIBarButtonItem* cancelButton = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelAction)];
self.navigationItem.leftBarButtonItem = cancelButton;
Also if you have used self.navigationItem.backBarButtonItem
in your parentViewController
, it will show that button in the childViewController's leftBarButtonItem by default, if your custom leftBarButton in the childViewController is not added properly.