NSURL *url = [NSURL URLWithString:@"http://localhost/News"];
NSString *jsonString 开发者_运维技巧= [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil];
NSLog(@"%@", jsonString);
NSDictionary *news = [jsonString JSONValue];
I get error when I try parse string to dictionary. (-JSONValue failed. Error is: Token 'string' not expected before outer-most array or object) and string "jsonString" in console is "[{\"ID\":1,\"Title\":\"First News\",\"Description\":\"First News\",\"ModifiedDate\":\"\/Date(1296597600000+0200)\/\",\"Images\":null}]"
How I can remove backslash?
Your JSON is not properly formatted, you are getting bad JSON. Please don't implement any remove backslash algorithm. Try to work on the web service which is sending this crap JSON.
精彩评论