Im having issues with my code, its returning an error that says...
2011-12-24 22:52:36.280 BusinessManager[479:20b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[NSCFDictionary isEqualToString:]: unrecognized selector sent to instance 0x3e965e0'>
Here is the 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
Im pretty sure I have everything set up correctly and the JSON is returning correctly in the console.