title: appearanceWhenContainedIn warning for ios 9
body: <p>I have some warning which worked well in ios 7 &amp; 8.  While we work with iOS 9 its gives me a warning.</p>
  
  <p><strong>This is the warning :</strong></p>
  
  <blockquote>
    <p>'appearanceWhenContainedIn:' is deprecated: first deprecated in iOS 9.0 - Use +appearanceWhenContainedInInstancesOfClasses: instead</p>
  </blockquote>
  
  <p>So I used this code : </p>
  
  <pre><code>[[UITextField appearanceWhenContainedInInstancesOfClasses:[UISearchBar class], nil] setTextColor:[UIColor whiteColor]];
  </code></pre>
  
  <p>Instead of this code:</p>
  
  <pre><code>[[UITextField appearanceWhenContainedIn:[UISearchBar class], nil] setTextColor:[UIColor whiteColor]];
  </code></pre>
  
  <p>But when I used I got the error:</p>
  
  <p><strong>Too many arguments to method call, expected 1, have 2</strong></p>
  
  <blockquote>
    <p>warning: <code>'base64Encoding' is deprecated: first deprecated in iOS 7.0</code></p>
  </blockquote>
  
  <p><strong>In below code:</strong></p>
  
  <pre><code> NSString *authValue = [NSString stringWithFormat:@"Basic %@", [authData base64Encoding]];
  </code></pre>
  
  <blockquote>
    <p>warning:  <code>'searchDisplayController' is deprecated: first deprecated in iOS 8.0</code></p>
  </blockquote>
  
  <p><strong>In below code:</strong></p>
  
  <pre><code>[self filterContentForSearchText:searchText scope:[[self.searchDisplayController.searchBar scopeButtonTitles]
                                                     objectAtIndex:[self.searchDisplayController.searchBar selectedScopeButtonIndex]]];
  </code></pre>
  
  <blockquote>
    <p>warning: <code>'sendSynchronousRequest:returningResponse:error:' is deprecated: first deprecated in iOS 9.0 - Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h</code></p>
  </blockquote>
  
  <p>In below code:</p>
  
  <pre><code>NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
  </code></pre>
  
  <p>I am working with iOS9. I need to remove all these warnings. Thanks in advance!</p>