Thursday, 25 February 2016

How to Get Data Using WebSerIvice IOS 9 With Plst Setting Ios/Iphone

======================================================= <key>NSAppTransportSecurity</key>
<dict>
  <key>NSExceptionDomains</key>
  <dict>
    <key>test.testdomain.com</key>
    <dict>
      <key>NSIncludesSubdomains</key>
      <true/>
      <key>NSTemporaryExceptionRequiresForwardSecrecy</key>
      <false/>
 </dict>

======================================================
NSMutableArray *searchResults =[[NSMutableArray alloc]init];
   
 
  NSString *strURL = @"http://google.com";
 

  NSURL *URL = [NSURL URLWithString:[[NSString stringWithFormat:@"%@", strURL]
stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]];

   NSURLRequest *request = [NSURLRequest requestWithURL:URL];
   
NSURLSession *session = [NSURLSession sharedSession];
  
 NSURLSessionDataTask *task = [session dataTaskWithRequest:request
      
                      completionHandler: ^(NSData *data, NSURLResponse *response, NSError *error)

{
                                      dict= [NSJSONSerialization JSONObjectWithData:data

   

                                                                       options:kNilOptions
                                                                              error:&error];
                                     
                                      keyArray = [dict objectForKey:@"videos"];
                                      NSLog(@"response: %@", recipes);
                                      [tblvw reloadData];
                                
 }];
   
  
 [task resume];