Note that there are some explanatory texts on larger screens.

plurals
  1. POParsing data from json to iphone application
    primarykey
    data
    text
    <p>I am parsing data from iphone app to json from server but it does not get data from the json </p> <p>i am using following code</p> <p>To get Data from json</p> <p>here is the link of my json data </p> <p><a href="http://celeritas-solutions.com/emrapp/surveyDescription.php?user_id=ali40" rel="nofollow">http://celeritas-solutions.com/emrapp/surveyDescription.php?user_id=ali40</a></p> <pre><code> NSString*user=@"ali40"; NSString *url=[NSString stringWithFormat:@"http://celeritas-solutions.com/emrapp/surveyDescription.php?user_id=%@",user]; NSLog(url); NSArray *tempArray =[[DataManager staticVersion] startParsing:url]; for (int i = 0; i&lt;[tempArray count]; i++) { id *item = [tempArray objectAtIndex:i]; NSDictionary *dict = (NSDictionary *) item; ObjectData *theObject =[[ObjectData alloc] init]; [theObject setUser_id:[dict objectForKey:@"user_id"]]; [theObject setSurvey_id:[dict objectForKey:@"survey_id"]]; [theObject setSurvey_title:[dict objectForKey:@"survey_Title"]]; [theObject setSurvey_Description:[dict objectForKey:@"survey_Description"]]; [theObject setDate_Created:[dict objectForKey:@"date_Created"]]; [surveyList addObject:theObject]; [theObject release]; theObject=nil; int count =[surveyList count]; NSLog(@"Total is %d",count); </code></pre> <p>DataManager Class</p> <p>DataManager *theInstance;</p> <pre><code> + (id)staticVersion{ if(!theInstance){ theInstance = [[DataManager alloc] init]; } return theInstance; } - (NSMutableArray *) startParsing:(NSString *)theURLString { NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@",theURLString]]; NSString *fileContent= [NSString stringWithContentsOfURL:url]; SBJSON *parser = [[SBJSON alloc] init]; NSDictionary *data = (NSDictionary *) [parser objectWithString:fileContent error:nil]; NSArray *items = (NSArray *) data ; return items; int count=[items count]; NSLog(@"This is testing %d",count); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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