I am getting ‘SBJSON’ undeclared (first use in this function) error when i try to run the below piece of code.
#import "RootViewController.h"
#import <JSON/JSON.h>
@implementation RootViewController
#pragma mark -
#pragma mark View lifecycle
- (void)viewDidLoad {
[super viewDidLoad];
NSString *myRawJson=[[NSString alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://myserver/jsondata.php"]];
if([myRawJson length]==0)
{
[myRawJson release];
return;
}
SBJSON *parser=[[SBJSON alloc]init];
list = [[parser objectWithString:myRawJson error:nil]copy];
[parser release];
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
Can anybody help please. I am using SDK 4.2.
I used SBJsonParser instead of SBJSON and it works fine now. Maybe it has something to do with the iOS version I am on..