objective c - -[UINavigationController <null selector>]: unrecognized selector sent to instance -


apologies if duplicate. if thankful link , happy delete question. however, did not find answer between tons of search results. not usual case of unrecognized selectors. selector nil. , thrown on line:

return self.topviewcontroller;

that line embedded in:

@implementation uinavigationcontroller (jtrevealsidebarv2)  - (uiviewcontroller *)selectedviewcontroller {     return self.topviewcontroller; }  @end 

as see attempt extend uinavigationcontroller. may have noticed code based on turorial: https://github.com/mystcolor/jtrevealsidebardemo (based on demo of version 2, if interested).

as far have noticed have not yet made change mystycolor's framework. not uiviewcontroller+jtrevealsidebarv2.h nor .m. far made changes 1 of 2 view controllers, presented. those, contain contents, not navigation logic.

apparently method being called. therefore category must have been used in correct way? , mystycolor using there, calls documented method , returns value. tutorial, foreign code, not ask me why topviewcontroller not called directly. try next of course, if helps i'd still courius went wrong here.

just out of curiosity did change expression return [self topviewcontroller];, no surprise did not make change.

i happy provide more code don't know sniplet may interesting help.

this not answer question why found out made wrong.

one fo view controllers working did not include

#import "uiviewcontroller+jtrevealsidebarv2.h" #import "uinavigationitem+jtrevealsidebarv2.h" 

the method selectedviewcontroller implemented both categories different things when being called. answer question why mystycolor did implement way.

and added these includes works fine.

but me error message still confusing. how method called @ all, when reason error appears extension, of method part of, not included everywhere?


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -