title: Implicit conversion of int to NSString is disallowed with ARC and Incompatible integer to pointer conversion assigning to NSString from int
body: <p>I'm having a bit of trouble with some code a developer gave to on this website. The code is meant to check for an internet connection. This is the code below:</p>
  
  <pre><code>@property (nonatomic, copy, getter = isConnected) NSString *connected;
  
  
  
  [[UIApplication sharedApplication] beginIgnoringInteractionEvents];
  
  
  NSURL *url = [NSURL URLWithString:@"http://www.apple.com/"];
  
  NSString *s = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil];
  
  dispatch_async(dispatch_get_main_queue(), ^{
  
      // hide the activity indicator
  
      self.connected = (s != nil);
  
  
  
      [[UIApplication sharedApplication] endIgnoringInteractionEvents];
  
      if (self.isConnected)
      {
          NSLog(@"self.connected == YES");
      }
      else
      {
          NSLog(@"self.connected == NO");
          NSString *alertMessage = @"In order to load images, you need an active Internet connection. Please try again later!";
  
          UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Sorry!" message:alertMessage delegate:nil cancelButtonTitle:@"Cancel"otherButtonTitles:nil];
  
          [alert show];
      }
  });
  </code></pre>
  
  <p>This code is placed in the <code>viewDidLoad</code> but I keep getting 2 errors saying <code>Implicit conversion of int to NSString is disallowed with ARC</code> and <code>Incompatible integer to pointer conversion assigning to 'NSString *' from 'int'</code> for <code>self.connected = (s != nil);</code>.</p>
  
  <p>Any help would be great!</p>