Note that there are some explanatory texts on larger screens.

plurals
  1. POIPhone JSON to TableView
    primarykey
    data
    text
    <p>Im having issues with my code, its returning an error that says... </p> <blockquote> <p>2011-12-24 22:52:36.280 BusinessManager[479:20b] <strong>* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*</strong> -[NSCFDictionary isEqualToString:]: unrecognized selector sent to instance 0x3e965e0'></p> </blockquote> <p>Here is the code:</p> <pre><code> #import "BusinessManagerAppDelegate.h" #import "ProspectViewController.h" #import "JSON.h" @implementation ProspectViewController @synthesize jsonArray; - (void)viewDidLoad { NSURL *jsonURL = [NSURL URLWithString:@"https://www.mysite.php"]; NSString *jsonData = [[NSString alloc] initWithContentsOfURL:jsonURL]; NSLog(jsonData); self.jsonArray = [jsonData JSONValue]; [jsonURL release]; [jsonData release]; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [jsonArray count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *Prospects = @"agencyname"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:Prospects]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:Prospects] autorelease]; } cell.text = (NSString *)[self.jsonArray objectAtIndex:indexPath.row]; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; } - (void)viewWillDisappear:(BOOL)animated { } - (void)viewDidDisappear:(BOOL)animated { } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } - (void)dealloc { [jsonArray dealloc]; [super dealloc]; } @end </code></pre> <p>Im pretty sure I have everything set up correctly and the JSON is returning correctly in the console. </p>
    singulars
    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.
 

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