Can anyone tell me the correct way to check if sender was a UIBarButtonItem or not. NSLog gives me these depending on what sender is:
sender for segue = <UIBarButtonItem: 0x6845e70>
sender for segue = <NSIndexPath 0x687fd00> 2 indexes [0, 0]
What command is used in an if statement to check for UIBarButtonItem?
Thanks
if([sender isKindOfClass:[UIBarButtonItem class]])
should do it for ya
Check this awnser: How do I test which class an object is in Objective-C?.
You could log the sender's class.
NSLog(@"Sender is a %@",NSStringFromClass([sender class]));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With