I heard from people that you should use self in viewDidUnload. For instance, this is good:
- (void)viewDidUnload
{
self.object = nil;
self.object2 = nil
}
- (void)viewDidUnload
{
object = nil;
object2 = nil;
}
Is there a difference between the 2? And what is it?
There is a difference. The code that is generated by @synthesize will call release on the references to the objects you have before setting the new value. A call to self.object = nil will effectively both release the reference and set it to nil. Without the self it will just set the reference to nil.