0

my Json string is "{'message':'Test Driver'}"

if i try to Nslog this code NSLog(@"%@",[parser objectWithString:[request responseString] error:nil]);

parser is an object of SBJsonParser class

Output: (null)

is there any other json library which can parse this string?

plz help to parse this Json string

0

4 Answers 4

3

The JSON response string is not a valid one, that's the reason why you are getting the error.

Use the following link to check if the JSON string, sent as response from Web services is valid one or not

JSONLint

Sign up to request clarification or add additional context in comments.

Comments

2

the raw JSON string should be in such a format

{"message":"Test Driver"}

Comments

1

As for other JSON libraries, if you're targeting iOS 5 or newer, Apple provides NSJSONSerialization.

Comments

0

you van use following code to generate appropriate json string and than parse it. It may help you

NSDictionary *resDict = [parser objectWithString:[[request responseString] stringByReplacingOccurrencesOfString:@"'" withString:@"\""] error:nil];

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.