title: Why my application crash on applicationDidEnterBackground?
body: <p>I have a <em>static method</em> called <code>writeToServer</code> that is called when application enter in <strong>background mode</strong>.</p>
  
  <p>in my <code>AppDelegate.m</code>:</p>
  
  <pre><code>- (void)applicationDidEnterBackground:(UIApplication *) application {
      [LogZone writeToServer];
      NSLog(@"Log sended to server. Done.");
  }
  </code></pre>
  
  <p>in my <code>LogZone.m</code>:</p>
  
  <pre><code>+ (void) writeToServer {
      NSString *qStr = [[NSString alloc]
          initWithFormat:@"%@?ip=%@&amp;uid=%@&amp;platform=%@&amp;model=%@&amp;lat=%@&amp;lon=%@",
              LOG_SERVER_URL,
              _LOG_IP, _LOG_UID, _LOG_PLAT, _LOG_MOD, _LOG_LAT, _LOG_LON];
  
      NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:qStr]];    
      [request setHTTPMethod: @"POST"];
      [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
  }
  </code></pre>
  
  <p>Uppercase vars are static strings created in this way:</p>
  
  <p>.h</p>
  
  <pre><code>extern NSString* _LOG_UID;
  </code></pre>
  
  <p>.m</p>
  
  <pre><code>NSString* _LOG_UID = @"-1";
  </code></pre>
  
  <p>When I enter in background mode it crash with this "<em>classic</em>" error:</p>
  
  <blockquote>
    <p><em>*</em> -[CFString respondsToSelector:]: message sent to deallocated instance
    0x6a4c800</p>
  </blockquote>
  
  <p>But why?<br>
  <em>I don't release anything!=!</em></p>
  
  <p><strong>What's wrong?</strong> </p>