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
Post a Comment