Instance variable 'variable' accessed in class method error

后端 未结 4 1961
长发绾君心
长发绾君心 2020-12-14 09:03

I have a variable declared in the header file :

@interface

int _nPerfectSlides;

and

@property (nonatomic, readwri         


        
4条回答
  •  [愿得一人]
    2020-12-14 09:36

    An instance variable is, as its name suggests, only accessible in the instance methods (those declared with -). Class methods (declared with +) have no access to instance variable, no more than they have access to the self object.

提交回复
热议问题