Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<pre><code>NSData *urlData=[NSURLConnection sendSynchronousRequest:request returningResponse:&amp;response error:&amp;error]; NSString *data=[[NSString alloc]initWithData:urlData encoding:NSUTF8StringEncoding]; NSArray *dataArr=[data JSONValue]; for (int i=0; i&lt;[dataArr count]; i++) { NSDictionary *dict=[dataArr objectAtIndex:i]; NSString *codeV=[dict valueForKey:@"CodeValue"]; NSString *codeD=[dict valueForKey:@"CodeDescription"]; NSString *active=[dict valueForKey:@"IsActive"]; NSString *codeT=[dict valueForKey:@"CodeType"]; NSString *codeId=[dict valueForKey:@"CodeID"]; NSString *updatedTime=[dict valueForKey:@"UpdateDateTime"]; NSLog([dict description],nil); } NSLog(@"%@", json_string); //May this will help you out. </code></pre> <p>Do include the JSon library classes to your project.</p> <p>I am doing in this way to insert in an array but it return o object</p> <pre><code> NSDictionary *dict=[dataArr objectAtIndex:i]; SearchCode *theObject =[[SearchCode alloc] init]; theObject.codeValue=[dict valueForKey:@"CodeValue"]; theObject.codeDescription=[dict valueForKey:@"CodeDescription"]; theObject.codeType=[dict valueForKey:@"CodeType"]; theObject.codeID=[dict valueForKey:@"CodeID"]; theObject.UpdateDateTime=[dict valueForKey:@"UpdateDateTime"]; NSLog(codeType); [cptArray addObject:theObject]; [theObject release]; theObject=nil; - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [cptArray count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; cell.selectionStyle=UITableViewCellSelectionStyleGray; cell.accessoryType = UITableViewCellAccessoryNone; } SearchCode *theObject =[cptArray objectAtIndex:indexPath.row]; cell.textLabel.text=theObject.codeValue; //&amp; so on you can access any value from "theObject" here } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload