title: Exception : 'Invalid Region <center:+inf, +0.00000000 span:+1.00000000, +0.50000000>' when trying to display the map
body: <p>When I try to display the map I get this exception :</p>
  <blockquote>
  <p>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid Region &lt;center:+inf, +0.00000000 span:+1.00000000, +0.50000000&gt;'</p>
  </blockquote>
  <p>My relevant code is this :</p>
  <pre><code>-(void)viewWillAppear:(BOOL)animated
  {   
      [mapView removeAnnotations:mapView.annotations];
      
      // locationManager update as location
      locationManager = [[CLLocationManager alloc] init];
      locationManager.delegate = self; 
      locationManager.desiredAccuracy = kCLLocationAccuracyBest; 
      locationManager.distanceFilter = kCLDistanceFilterNone; 
      [locationManager startUpdatingLocation];
      CLLocation *location = [locationManager location];
      //Configure the new event with information from the location
      CLLocationCoordinate2D coordinate = [location coordinate];
      
      latitudeOfUserLocation=coordinate.latitude;
      longitudeOfUserLocation=coordinate.longitude;
      
      location2D = (CLLocationCoordinate2D){ .latitude = latitudeOfUserLocation, .longitude = longitudeOfUserLocation };
      MyLocation *annotation=[[[MyLocation alloc]initWithName:@&quot;You are here&quot; distanceVersLaStation:@&quot;&quot; coordinate:location2D]autorelease];
      annotation.pinColor = MKPinAnnotationColorRed;  
      [mapView addAnnotation:annotation];
      
      MKCoordinateSpan span={latitudeDelta:1,longitudeDelta:0.5};
      MKCoordinateRegion region={location2D,span};
      [mapView setRegion:region];
  
  }
  </code></pre>
  <h3>Edit</h3>
  <p>I tried to do as you said in the comments. The exception is solved, however, when I try to display the longitude/latitude of the user in the console I get nothing. This is my code which is mostly correct:</p>
  <pre><code>    -(void)viewWillAppear:(BOOL)animated
      {  
              
          [mapView removeAnnotations:mapView.annotations];
          
          // locationManager update as location
          locationManager = [[CLLocationManager alloc] init];
          locationManager.delegate = self; 
          locationManager.desiredAccuracy = kCLLocationAccuracyBest; 
          locationManager.distanceFilter = kCLDistanceFilterNone; 
          [locationManager startUpdatingLocation];
          NSURL *url=[NSURL         URLWithString:@&quot;http://ipho.franceteam.org/ad_V1/stations/&quot;];
      ASIFormDataRequest * request=[ASIFormDataRequest requestWithURL:url];
  [request setPostValue:[NSNumber numberWithFloat:longitudeOfUserLocation] forKey:@&quot;longitude&quot;];
      [request setDelegate:self];
      [request startAsynchronous];
      MBProgressHUD *hud=[MBProgressHUD showHUDAddedTo:self.view animated:YES];
      hud.labelText=@&quot;Recherche en cours..&quot;;// this never stop loading
  
      }
  
  -(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
  {
      CLLocation *location = [locationManager location];
      //Configure the new event with information from the location
      CLLocationCoordinate2D coordinate = [location coordinate];
      latitudeOfUserLocation=coordinate.latitude;
      longitudeOfUserLocation=coordinate.longitude;
      NSLog(@&quot;your latitude :%f&quot;,latitudeOfUserLocation);//here nothing is shown
      NSLog(@&quot;your longitude :%f&quot;,longitudeOfUserLocation);// and here too
      location2D = (CLLocationCoordinate2D){ .latitude = latitudeOfUserLocation, .longitude = longitudeOfUserLocation };
      MyLocation *annotation=[[[MyLocation alloc]initWithName:@&quot;Vous êtes ici&quot; distanceVersLaStation:@&quot;&quot; coordinate:location2D]autorelease];
      annotation.pinColor = MKPinAnnotationColorRed;  //or red or whatever
      [mapView addAnnotation:annotation];
      //
      MKCoordinateSpan span={latitudeDelta:1,longitudeDelta:0.5};
      MKCoordinateRegion region={location2D,span};
      [mapView setRegion:region];
  
  }//End function
  </code></pre>
  <p>Even I work on the simulator, I should get something on the console right?</p>
  <h3>Edit</h3>
  <p>Hi again, i had the opportunity to test my code on iPhone (device) and i have noticed that when i try to search, the application has succeeded to track my position and to find me the stations that meet my search (purple annotation), however, the map isn't displayed and the searching progress is still loading and never stop.</p>
  <pre><code>hud.labelText=@&quot;Recherche en cours..&quot;;// this never stop loading
  </code></pre>
  <p>Here is a screenshot that could explain better:</p>
  <p><img src="https://i.stack.imgur.com/ZlFPI.png" alt="screenshot" /></p>