objective c - ios unrecognized selectors sent to instance -


have worked through excellent answers here unrecognized selector sent instance still unable debug this.

error

* terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[uitabbarcontroller disabletabbaritemwithindexno:]: unrecognized selector sent instance 0x1184dfa0' * first throw call stack:

setting breakpoint issue appears here

[appdelegate tabbarcontroller:shouldselectviewcontroller:]

[tbc disabletabbaritemwithindexno:index];

i believe code causing issue this:

- (bool)tabbarcontroller:(customtabbarcontroller *)tbc shouldselectviewcontroller:(uiviewcontroller *)viewcontroller { if ([viewcontroller ismemberofclass:[actionviewcontroller class]])  {     nsinteger index = [tbc.viewcontrollers indexofobject:viewcontroller];     cgrect frame = [[[self tabbaritemviewlist:tbc] objectatindex:index] frame];     actionviewcontroller* content = [[actionviewcontroller alloc] init];     uipopovercontroller* popover = [[uipopovercontroller alloc] initwithcontentviewcontroller:content];     [content release];     popover.delegate = self;     popover.popovercontentsize = cgsizemake(popover.popovercontentsize.width, 411.0);      [tbc disabletabbaritemwithindexno:index];      // store popover in custom property later use.     self.currentpopover = popover;     [self.currentpopover presentpopoverfromrect:frame inview:tbc.tabbar permittedarrowdirections:uipopoverarrowdirectionany animated:yes];      return no; } 

this driving me crazy, sure have hooked in ib correctly, , custom controller should respond method call. appreciated!

just check set class of custom tab bar customtabbarcontrollerin nib instead of uitabbarcontroller.

and can add if([tbc respondstoselector:@selector(disabletabbaritemwithindexno:)]) before calling method prevent crash.


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -