Questions tagged [nsjsonserialization]

NSJSONSerialization class is used to convert JSON to Foundation objects and Foundation objects to JSON

NSJSONSerialization class is used to convert JSON to Foundation objects and Foundation objects to JSON.

More information: NSJSONSerialization Class Reference

709 questions
-1
votes
1 answer

Exception while try to send async get request during singleton initialisation

here is my code: + (instancetype)sharedInstance { static PanoramaDataManager *sharedInstance = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ sharedInstance = [[PanoramaDataManager alloc] init]; …
ShurupuS
  • 2,923
  • 2
  • 24
  • 44
-1
votes
1 answer

Parsing JSON with NSJSONSerialization - NSException thrown

I'm using NSJSONSerialization to parse JSON pulled down from a PHP page. The following code is supposed to parse the JSON and show the value of the data field (JSON sample included first): {"status":200,"status_message":"Book…
muttley91
  • 12,278
  • 33
  • 106
  • 160
-1
votes
1 answer

NSJSONSerialization with an integer

I'm writing an iOS application that gets data from a web request. The request returns the following: {"hash":"0369a5d5e65335309b2b1502dc96b5aba691b9451c83b9","error":0} I get the data from the NSData* responseData object as follows: NSDictionary*…
jtmarmon
  • 5,727
  • 7
  • 28
  • 45
-1
votes
3 answers

Objective-C - "success" not equal to "success"

The basic gist: I've got some JSON coming back from a webservice to validate a login; that part works. I'm pulling values out of the array into an NSDictionary; that part works. I need to check one of the values that comes back to know if it was…
Given Reed
  • 11
  • 2
-1
votes
3 answers

Unable to read data after NSJSONSerialization

I am getting a json array from the server. The jsonOutput object shows 2 objects correctly. But am unable to display or extract the data. Could some one help me out. I tried the following way : for (id key in jsonOutput) { NSLog(@"key:…
user2569524
  • 1,651
  • 7
  • 32
  • 57
-1
votes
4 answers

App gets crashed because object at index is beyond empty array

I am accessing data from the json web services into my application. whenever there is no json data the app gets crashed, I am using nsjsonserialization is there anyway I can find out the empty array at response itself and display the error, thus not…
-1
votes
2 answers

NSJSONSerialization does not return data, but its showing data in json viewer

NSJSONSerialization returns null when i try to implement a particular api from the server, but other api's from the server works fine , when i tried the api in web it returns data of json type , and i have checked it in json viewer also , and it…
vinay
  • 351
  • 1
  • 5
  • 16
-1
votes
1 answer

Displaying Google Feed JSON in my UITableView

I've tried to get the Google JSON data and put on my UITableView, but it's not showing up. Check the google JSON return: I've got the JSON and put on my dictionary already like you would do with a normal JSON, but the google one isn't…
Rodrigo Parra
  • 243
  • 1
  • 3
  • 16
-1
votes
1 answer

NSJsonSerialization Post request Method

I have used SBJsonParser and ASIFormDataRequest for Posting and JSON Parsing, like NSString *urlStr = @"http:facebookpage/second/index.php"; NSURL *log_Url = [NSURL URLWithString:urlStr]; request = [ASIFormDataRequest…
Harish
  • 2,496
  • 4
  • 24
  • 48
-1
votes
2 answers

release outside created autoreleased object inside a autoreleasepool {}

How can i force a autoreleasepool to release my autorelease object which was created outside the autoreleasepool {} the code im using - (void)connectionDidFinishLoading:(NSURLConnection *)theConnection { NSError *error = nil; id response =…
-1
votes
1 answer

Saving Twitter Streaming APIs results

Hi all so after a lot of hassle I managed to finally work my way around achieving and delimiting the JSON returned by Twitter Streaming APIs. How do i store the data returned by [NSJSONSerialization JSONObjectWithData:options:error:] into an array…
-1
votes
1 answer

NSCocoaErrorDomain Code=3840 issue while retrieving NSDATA to NSDictionary

I am creating iOS app which uses SQLite DB. I have created Table As: const char *sql_stmt = "CREATE TABLE IF NOT EXISTS ORDERTABLE (ID INTEGER PRIMARY KEY AUTOINCREMENT, ITEMDESC BLOB)"; and then I have to insert self.selectedItemsDictnory…
Sulabh
  • 11
  • 2
  • 6
-1
votes
1 answer

displaying JSON data with the help of dictionaries and array

I get the following error [__NSCFDictionary objectAtIndex:]: unrecognized selector sent to instance 0x75a8e20 2013-04-20 08:56:14.90 MyApp[407:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:…
BarryVenom
  • 13
  • 3
-1
votes
1 answer

YELP 1.0 JSON access with NSDictionary

I was doing pretty good parsing YELP1 Json with NSJSONSerialization and accessing the data with NSDictionary. However, I figured inconsistencies in the response: Some keys are surrounded with " , mostly the ones containing a _ Parts from the…
El Dude
  • 5,328
  • 11
  • 54
  • 101
-1
votes
2 answers

NSJSONSerialization not mapping boolean correctly

I am reading data from The Joys of Code. The API returns data in JSON format where boolean variables are written as so: { "obj" : { "sharing":false, "modified":"tuesday" } } Notice, sharing:false does not have quotation marks…
Paul de Lange
  • 10,613
  • 10
  • 41
  • 56