title: retrieve data from php file in Xcode
body: <p>I tried different codes to both send and retrieve data from a PHP file and i'm still not able to properly get the result
  So far, I got the retrieval results to be displayed in the output debugger(in json format) however, not in the Xcode simulator. it seems like i'm missing something! </p>
  
  <pre><code>- (void) retrieveData
  {
  
  
  
  NSString * jack=[GlobalVar sharedGlobalVar].gUserName;
  NSLog(@"global variable %@", jack);
  
  
  
  NSString *rawStr = [NSString stringWithFormat:@"StudentID=%@",jack];
  NSData *data = [rawStr dataUsingEncoding:NSUTF8StringEncoding];
  
  NSURL *url = [NSURL URLWithString:@"http://m-macbook-pro.local/studentCourses.php"];
  NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
  
  [request setHTTPMethod:@"POST"];
  [request setHTTPBody:data];
  
  NSURLResponse *response;
  NSError *err;
  NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&amp;response error:&amp;err];
  NSLog(@"responseData: %@", responseData);
  
    jsonArray=[NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
  
  // Search for the array parameter that should be added
   coursesArray=[[NSMutableArray alloc] init];
  //set up our cities array
  
  NSString *strResult = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
  NSLog(@"me: %@", strResult);
  
  
  
  //loop through our json array
  
  for (int i = 0 ; i &lt;coursesArray.count; i++)
  {
      NSString * cName = [[coursesArray objectAtIndex:i] objectForKey:@"CourseName"];
  
      //Add the City object to our cities array
      [coursesArray addObject:[[Course alloc]initWithCourseName:cName]];
  
  }
  
  //Reload our table view
  [self.tableView reloadData];
  }
  </code></pre>
  
  <p>in php file</p>
  
  <pre><code>echo json_encode($records);
  </code></pre>