title: Getting a segfault (EXC_BAD_ACCESS) when deallocating variables
body: <p>Ok I understand that this error mostly comes from sending a method call or trying to access a variable that has already been deallocated.</p>
  
  <p>Here is the problem:</p>
  
  <pre><code>.h
  @interface TimeEntry : NSObject &lt;NSCopying, NSCoding&gt; {
  
  NSDate *from;
  NSDate *to;
  
  NSString *information;
  
  
  }
  
  @property (nonatomic, retain) NSDate *from;
  @property (nonatomic, retain) NSDate *to;
  
  @property (nonatomic, copy) NSString *information;
  
  @end
  </code></pre>
  
  <p>And my classes' dealloc.</p>
  
  <pre><code>-(void)dealloc{
  
      [super dealloc];    
      [to release];
      [from release];
      [information release];
  
  }
  </code></pre>
  
  <p>This is the traceback thing when I get the EXC_BAD_ACCESS error
  <img src="https://farm4.static.flickr.com/3596/3290604341_c78fae9981.jpg?v=0" alt="alt text"></p>
  
  <p>So I'm sending a message to an object that has been deallocated right?</p>
  
  <p>So I turned on NSZombie and this STOPPED my crashes. It didn't give me some lovely crash report like I'd hoped. Instead it just kept the program from crashing.</p>
  
  <p>In the dealloc method above if I comment out [to release] and [from release] the app doesnt crash. If I comment out just one of them.. it doesn't crash. In the debug window to and from have different memory addresses.</p>
  
  <p>How can memory management be so hard!!!!</p>
  
  <p>Any clues anyone?</p>
  
  <p>Thanks,</p>
  
  <p>Dan</p>