i have a simple question :
if we don’t use here the dataController property in another class in the project, we don’t really need to use the “@property” and synthesize and we could have just done a simple “=” operation with dataController = controller, like in the second chunk of code? :
DataController *controller = [[DataController alloc] init];
self.dataController = controller;
[controller release];
rootViewController.dataController = dataController;
Second one :
DataController *controller = [[DataController alloc] init];
dataController = controller;
So if we don’t need a property outside the class, we could just do it this way?
Thanks
You are correct, if dataController is a retaining property.
If you are just using it once, there is not much to gain with a property. If you change its value often (i.e. assign a different DataController) then even a private property can make sense just to make the memory management easier.