ios - Why does this code cause an error? (Use of undeclared ideatifier '_maxConcurrentRequestCount') in Xcode -


why code cause error in xcode? (use of undeclared ideatifier '_maxconcurrentrequestcount')

@interface httpkit : nsobject @property (nonatomic) nsinteger maxconcurrentrequestcount; @end  @implementation httpkit  - (void)setmaxconcurrentrequestcount (nsinteger)maxconcurrentrequestcount {  }  - (nsinteger)maxconcurrentrequestcount {     if (!_maxconcurrentrequestcount) {         _maxconcurrentrequestcount = 1;     }     return _maxconcurrentrequestcount; }  @end 

please me resolve problem.

why must use code below fixed it?

@synthesize maxconcurrentrequestcount = _maxconcurrentrequestcount; 

if override default getter , setter of property property won't automatically synthesized , no ivar created property.

you can either manually synthesize property said or create own ivar:

@interface httpkit : nsobject {     nsinteger _maxconcurrentrequestcount; }  ... @end 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -