I have a simple question. I was referring "Your first iOS application" document by apple.I found that the class has a property called myViewController:
@interface applicationClass
{
MyViewController *myViewController
}
Now to assign a memory to this pointer, the code shown is:
MyViewController *aViewController = [[MyViewController alloc]
initWithNibName:@"MyViewController" bundle:[NSBundle mainBundle]];
[self setMyViewController:aViewController];
[aViewController release];
My doubt here is, what is wrong if this is done as follows:
self.myViewController = [[MyViewController alloc]
initWithNibName:@"MyViewController" bundle:[NSBundle mainBundle]];
I cannot find this kind of instantiation where a property is assigned directly in many of the documents. Instead, a temporary memory is allocated and then it is retained by the property. Can anyone guide me if I am wrong ?