iPhone Memory release issue
<p>I've some doubts regarding dealloc function in iPhone program. Is it required to give [self.object_name release] or [object_name release] is ok?..
I've this strange problem in my dealloc function is like this.</p>

<pre><code>-(void) dealloc {
   [self.listOfDates release];
   [self.listOfDescriptions release];
   [super dealloc];
 }
</code></pre>

<p>But program crashes giving EXEC_BAD_ACCESS. Here both objects are NSMutableArray instances allocated with alloc in init function for the class. The same function without self works fine i.e</p>

<pre><code>-(void) dealloc {
    [listOfDates release];
    [listOfDescription release];
    [super dealloc];
 }
</code></pre>

<p>Here is how I declared the property</p>

<pre><code>@property (nonatomic,retain) NSMutableArray *listOfDates;
@property (nonatomic,retain) NSMutableArray *listOfDescription;
</code></pre>

<p>In the implementation file I sysnthesized this and inside the init function I've allocated these variables like this</p>

<pre><code>self.listOfDates = [[NSMutableArray alloc] init];
self.listOfDescription = [[NSMutableArray alloc] init];
</code></pre>

<p>So is it required to give self ? What am I missing here?</p>

<p>Issue resolved when I removed mutableCopy function which I had used to copy instance of NSMutableArrays which were passed as argument to the init function as shown below</p>

<pre><code>-(id)initWithDate:(NSMutableArray *)dates andDescription:(NSMutableArray*)descriptions
{
    if(self = [super initWithNibName:@"DateDescriptionControl" bundle:nil])
    {
        self.listOfDates = [[NSMutableArray alloc] init];
        self.listOfDescription = [[NSMutableArray alloc] init];

        self.listOfDates = [dates mutableCopy];
        self.listOfDescription = [description mutableCopy]; 

    }

   return self;
}
</code></pre>

<p>After removing the mutableCopy the dealloc is now not throwing EXEC_BAD_ACCESS. So where have I made the mistake I still can't figure out :(</p>
