Possible Duplicate:
Property Declaration and Automatic Backing Storage Allocation
I know the basic functions of @property and @synthesize directives, but recently I found a sample code: 
There’s not any class member variables in TTDownloader, but it works perfect.
TTDownloader *dl = [[TTDownloader alloc] init];
NSLog(@"%d %@", dl.aaa, dl.bbb); // result: 0 (null)
dl.aaa = 101;
dl.bbb = [NSNumber numberWithInt:201];
NSLog(@"%d %@", dl.aaa, dl.bbb); // result: 101 201
My questions are listed below:
-
Where is aaa and bbb? I don’t even have a place to hold these data. TTDownloader is empty (except some variables and functions derived from NSObject).
-
Did I miss some great features of Objective C? Are they described in Obj-C Programming Guide, I just read part of it.
Thanks in advance.
In the modern runtime on all platforms except 32 bit OS X, when you synthesize a property, if the instance variable has not been declared, it will be created automatically. so
aaa and bbb are properties i.e. each is a pair of accessor methods which are synthesized and use the instance variables _aaa and _bbb respectively.
Yes, see above.