title: Trying to find out why my app crashes?
body: <p>This is my code:</p>
  
  <pre><code>-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
      NSLog(@"location for url1 B %@", locationForURL1);
      if ((alertView.tag &lt;= 3) &amp;&amp; (alertView.tag &gt;= 1)) {
          if (buttonIndex == 1) {
              NSLog(@"location for url1 %@", locationForURL1);
  </code></pre>
  
  <p>The locationForURL1 had an entry in it in the rest of the code up until that point, but it crahes at the first NSLog here.</p>
  
  <p>So i added nszombieenabled and got <code>message sent to deallocated instance 0x508eda0</code>. How do i use this to find out my problem? I've heard people saying put it in the init method, which confused me as i can't find an init method. I've never done debugging like this before.</p>
  
  <p>EDIT:</p>
  
  <p>I am allocating it like this:</p>
  
  <pre><code>@interface RewriteViewController : UIViewController &lt;MPMediaPickerControllerDelegate&gt; {
  
      NSString *locationForURL1;
  }
  
  @property (nonatomic,retain) NSString *locationForURL1;
  </code></pre>
  
  <p>I think it's something to do with the self.VARIABLE thing, but i can never figure out when i'm meant to put the self. and if i'm meant to put something else instead.</p>
  
  <p>This is all the references i have to locationForURL1 in the .m file:</p>
  
  <pre><code>@synthesize locationForURL1;
  
  -(void)getWeatherLocation {
  
  if (currentResult == 1) {
          self.locationForURL1 = locationTown;
          locationForURL1 = [locationForURL1 stringByAppendingString:@","];
          locationForURL1 = [locationForURL1 stringByAppendingString:locationCountry];
  
      }
  }
  
  
  -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
      if ((alertView.tag &lt;= 3) &amp;&amp; (alertView.tag &gt;= 1)) {
          if (buttonIndex == 1) {
              NSLog(@"location for url1 %@", self.locationForURL1);
          self.weatherFullURL = [self.weatherFullURL stringByAppendingString:self.locationForURL1];
  
          }
      }
  }
  
  -(void)dealloc {
  
  
      [locationForURL1 release];
  
  [super dealloc];
  
  }
  </code></pre>