I am new to Objective-C, and I read Alasder Allan's “Programming the iPhone”. While reading, I found this code:
@interface RootController : UIViewController <UITableViewDataSource, UITableViewDelegate> { UITableView *tableView; NSMutableArray *cities; }
Relative implementation begins as follows:
@implementation RootController @synthesize tableView;
Now: I found out that @synthesize is a kind of shortcut to avoid boring getters and setters.
But I have a question:
- tableView is never explicitly named in the implementation code, but dealloc frees it;
- If it is never explicitly called, why @synthesize?
Is it mandatory to synthesize IBOutlets?
ios objective-c iphone
user840248
source share