When to use self with instance variables assignments in iphone
<p>I have some confusion about when to use the self keyword during ivars assignment, should I use it when I'm trying to assign certain value to ivar or only when I'm trying to access the ivar?</p>

<p>Besides, if I do retainCount on an ivar after its assignment without using self, it prints a count of 1 assuming it was already alloc &amp; init. But if I use self it gives me retain count of 2.</p>

<p>Example Code:</p>

<p>Titles = [[NSMutableDictionary alloc] init]; </p>

<p>NSLog(@"Titles before assignment: %d", [Titles retainCount]); // print 1</p>

<p>Titles = anotherDictionary;
NSLog(@"Titles after assignment: %d", [Titles retainCount]); // print 1</p>

<p>self.Titles = anotherDictionary;
NSLog(@"Titles after assignment: %d", [Titles retainCount]); // print 2</p>

<p>Should not I use self during assignment or when should I use? Any help would be really very appreciated as this situation is giving me a lots of doubts that my ivars are not being released the proper way.</p>

<p>Thanks,
Mohsen</p>

<p>Edit: I have another related issue to my above question, should I use self to assign singleton classes properties?</p>
