tags:

views:

302

answers:

1

Hello,

I am getting an odd error:

2009-09-12 18:47:15.967 CraigsAlerts[10057:207] * -[UINavigationController popNavigationItemAnimated:]: unrecognized selector sent to instance 0x191c7e0 2009-09-12 18:47:15.968 CraigsAlerts[10057:207] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UINavigationController popNavigationItemAnimated:]: unrecognized selector sent to instance 0x191c7e0'

My app is navigation based, and at the point I make this call I am 4 levels deep. The call looks like:

[self.navigationController popNavigationItemAnimated:YES];

I do get a warning on that line:

warning: 'UINavigationController' may not respond to '-popNavigationItemAnimated:', which is the part that is really throwing me. I am in my view code at the time, and I use popNavigationItemAnimated in other area's without this warning.

I am able to call the [self.navigationController popToRootViewControllerAnimated:YES];without warning or incident, which leads me to believe my navigation controller is intact.

Thanks in advance!

+2  A: 

the popNavigationItemAnimated: is used for a UINavigationItem only not for a UINavigationController object.

If you're looking for a way to pop navigation views than try a [self.navigationController popViewControllerAnimated:YES]; instead.

David Wong
Thank you, that was the issue.
Rob Bonner