ios - Calling method from different class sometimes works and sometimes doesn't -
i trying call set of methods 1 class reside in class.
the methods reside in viewcontroller.m
class , trying call them other class called myclass.m
.
sometimes works , doesn't.
the errors are
unrecognized selector sent class 0x1071c0050
terminating app due uncaught exception 'nsinvalidargumentexception', reason: '+[viewcontroller setprogressvalue:]: unrecognized selector sent class 0x1071c0050'
when error suggests went wrong @ [viewcontroller setprogressvalue:]
exclusively called within viewcontroller.m
resides there.
the flow looks this: viewcontroller.methoda -> myclass.methodb -> viewcontroller.methodb
this not work, following works viewcontroller.methoda -> myclass.methodb -> viewcontroller.methodc
how come first flow doesn't works second does?
the error very descriptive. calling method not exist.
you're calling setprogressvalue:
class method, instance method. please note '+' in error description. need call on concrete instance of viewcontroller
.
Comments
Post a Comment