Questions tagged [sbjson]

Related to the SBJson Objective-C JSON parser/generator.

SBJson's homepage is at:

Source code available at:

Tests, containing useful examples:

Example app:

182 questions
2
votes
1 answer

Unrecognized selector in SBJSON with Facebook v3.0.8?

I downloaded the Facebook SDK 3.0.8, and I am using it as per the instructions (dragging the framework and resource bundles). I attempt to authenticate, and it works fine. Then I do: FBRequest *me = [FBRequest requestForMe]; [me…
pj4533
  • 1,701
  • 4
  • 17
  • 38
2
votes
1 answer

Duplicate Symbol SBJSON on iOS Facebook SDK V 3.0

In the current project, I used SBJSON everywhere and got it working fine with the previous version of iOS Facebook SDK since SBJSON was included in Facebook SDK. I just upgraded to iOS Facebook SDK version 3.0 and having problem with SBJSON. The…
L N
  • 2,856
  • 4
  • 20
  • 30
2
votes
4 answers

iOS objective-c - JSON String to NSDictionary Exception

I'm relatively new to Objective-C, and followed a tutorial on an introduction to MapKit (located here). I've been trying to debug an issue with a JSON string being passed to an NSDictionary. I'm getting the following error: 2012-08-13 11:18:30.370…
Joshua Haines
  • 349
  • 5
  • 8
2
votes
2 answers

SBJsonWriter Nested NSDictionary

I'm trying to serialize an objc object with Json to send it to a server. That same server sends the following on GET for this object type: { "TypeProperties":[ {"Key":"prop 0","Value":"blah 0"}, {"Key":"prop 1","Value":"blah 1"}, …
Jimmy_m
  • 1,568
  • 20
  • 24
2
votes
2 answers

SBJSON append new data into existing JSON file without parsing it first

I am making an app that lets the user draw on the screen in different colors and brush sizes. I am storing the info about each drawn path in a JSON file once it has been drawn to keep it out of memory. Right now I have it parsing all existing…
Nate_Hirsch
  • 671
  • 1
  • 6
  • 12
2
votes
3 answers

Why does SBJson JSON parsing only get the last key of interest?

I am using the following JSON: http://www.kb.dk/tekst/mobil/aabningstider_en.json When I try to parse it by the key "location" as such: // get response in the form of a utf-8 encoded json string NSString *jsonString = [[[NSString alloc]…
Piotr
  • 1,437
  • 6
  • 19
  • 24
2
votes
1 answer

asihttprequest how to post json with SBJson?

I have write one method: -(id)postAndParseJson:(NSMutableDictionary *)theDictionary action:(NSString *)action type:(NSString *)myType { NSString *newJSON = [theDictionary JSONRepresentation]; NSLog(@"what to send: %@", newJSON); NSURL…
Tan
  • 179
  • 3
  • 16
2
votes
3 answers

SBJsonParser Memory Leak

I've used leaks to locate a memory leak that is related to SBJsonParser tho I don't understand why I'm getting it? I was hoping someone might be able to shed some insight. Leaks reports that the leak is coming from a method called objectWithURL.…
Johnny Rottenweed
  • 327
  • 1
  • 7
  • 16
2
votes
1 answer

iOS JSON Parse into NSDictionary and then NSArray with SBJson

It should be so simple but I cannot get it work. Json response is ([{"id":"1", "x":"1", "y":"2"},{"id":2, "x":"2", "y":"4"}]) NSString *response = [request responseString]; //response is ([{"id":"1", "x":"1", "y":"2"},{"id":2, "x":"2",…
MomentH
  • 1,979
  • 5
  • 22
  • 24
1
vote
3 answers

Unrecognized selector when using sbjson

i'm trying to follow this tutorial here http://ios-blog.co.uk/iphone-development-tutorials/parsing-json-on-ios-with-asihttprequest-and-sbjson/ to do both the ASIHttp and SBJSon tutorial at the same time and all is well until the line NSMutableArray…
acvon
  • 161
  • 3
  • 6
  • 21
1
vote
1 answer

Sending JSON to IIS from iPhone in hebrew the string cut before the end

Im sending data to a server from my iPhone app, with this code: - (void) sendGeneral:(NSString *) general{ self.responseData = [NSMutableData data]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL…
Shimon Wiener
  • 1,142
  • 4
  • 18
  • 39
1
vote
1 answer

json-framework - Token 'start of array' not expected after outer-most array or object

Feeding the json-parser with the this data: http://mapadosradares.com.br/api/get_initial_load yields this error: Token 'start of array' not expected after outer-most array or object Here is my code: - (void)connection:(NSURLConnection *)connection…
Raphael
  • 7,972
  • 14
  • 62
  • 83
1
vote
2 answers

NSData or NSAttributedString with SBJSON

I am using the SBJSON to convert my NSDictionary to a JSON String in my iOS application. when my dictionary contains a NSAttributedString or an NSData, the SBJSON fails to generate the string representaiton. Incase of NSAttributedString, the error…
Roshit
  • 1,589
  • 1
  • 15
  • 37
1
vote
3 answers

SBJson parsing boolean value

I'm using SBJson to parse some JSON result from a webservice. The problem is I'm not sure how SBJson handles boolean types. The service returns it as a true or false value; is this handled automatically in SBJson or do I have to detect it myself?
sarunw
  • 8,036
  • 11
  • 48
  • 84
1
vote
2 answers

NSDictionary objectForKey throws Exception NSCFString

This is my code: NSError *error = nil; SBJsonParser *parserJson = [[SBJsonParser alloc] init]; NSDictionary *jsonObject = [parserJson objectWithString:webServiceResponse error:&error]; [parserJson release], parserJson = nil; …
LuckyStarr
  • 1,468
  • 2
  • 26
  • 39
1 2
3
12 13