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
0
votes
1 answer

Parsing JSON: Checking for object existence and reading values

My application returns a NSMutableData *receivedData. I've opted for using NSJSONSerialization to parse this under the assumption that it would be easiest. I'm having extreme trouble trying to get my head around how to do it. I'm very new to…
user873578
0
votes
1 answer

How to make Xcode compile an included local JSON file in binary form?

I have some local JSON files which I'm bundling with the app. When Xcode builds the product and I look into the payload directory, I can see the JSON in plain text. Is there a way to have Xcode compile the file in binary form, and then still be able…
openfrog
  • 40,201
  • 65
  • 225
  • 373
0
votes
1 answer

Count how many of a certain object appear in a JSON query

I'm returning JSON with a rough structure like the one below, and I'm trying to figure out how I can count how many platforms there are (in this case, three, but could be anything from 1 to 20 or so). I've returned the JSON into an NSDictionary and…
Luke
  • 9,512
  • 15
  • 82
  • 146
0
votes
1 answer

json service from data scraping with php

I am trying to figure out what is the best way to make this work, I am new to php. I was able to make my script work to find specific data on my htm file with the following script tested on my local server.
thefern
  • 367
  • 7
  • 19
0
votes
1 answer

Error in connectionDidFinishLoading that I can resolve

I have a simple JSON array that is returned from a zip code passed to a third party service. http://api.geonames.org/findNearbyPostalCodes?postalcode=94115&country=US&radius=5&username=frequentz I get an unknown error when trying to deserialize the…
brianhevans
  • 1,183
  • 4
  • 15
  • 28
0
votes
1 answer

Consuming JSON-data in iOS

I am confused about JSON consuming in iOS. I am trying to use NSJSONSerialization. I found a tutorial from Ray Wenderlich discussing working with JSON on iOS5 using dispatch async. But in some tutorials I found, they were using…
0
votes
2 answers

Issues getting json from webserver in iOS5

I have a app that receive a feed from a server through json. I have been building it for iOS5, but in the last weeks testing with iOS6. I tested today with a iOS5 device, and everything crashed. The code looks like this: NSData *data = [NSData…
lagos
  • 1,968
  • 3
  • 17
  • 26
0
votes
1 answer

iOS 5 - Unable to convert hex escape sequence (no high character) to UTF8-encoded character

After a good while of searching over the internet, I refer to you for a quick help. I am developing an iOS 5 application (targeted for iPhone) that consumes some JSon data. Everything worked fine, until the guys on the server side decided to…
0
votes
1 answer

Extract inner json data xcode with NSJSONSerialization

My json response from a URL is: [ {"status":0, "id":"26", "content":"See info field for info", "time":1347565292761, "info": {"id":"26", "name":"Ruti", "twitterPageFollowers":null, "facebookPageLikes":null, …
Dejell
  • 13,947
  • 40
  • 146
  • 229
0
votes
1 answer

NSJSON Loop Trouple

I am getting my data but it seems like the data is posting in NSLog everytime it finds my "is reservable"=1; I think this should only post once and when I display it in a tableview cell would it post more than once? Here is my NSLog: 2012-08-31…
TIDev
  • 109
  • 4
  • 10
0
votes
5 answers

Arrary of Dictionaries or Dictionary with arrays?

Here is my json from my php page. Is this an Arrary of Dictionaries or just A dictionary with a keys and Dictionaries inside those keys? I think it is the second option but I am not sure because I was getting conflicting options. Also would the…
TIDev
  • 109
  • 4
  • 10
0
votes
2 answers

Populate UITableView Cells from JSON dates

I am having a hard time populating the tableview cells with json feed dates field. I think it has do to with the way I am getting the dates NSMutableArray *datesArray = [[NSMutableArray alloc] init]; for (NSDictionary *tempDict in json){ …
TIDev
  • 109
  • 4
  • 10
0
votes
2 answers

NSJSONSerialization - duplicate key error character at (index), char is ":"

I created a servlet which responds to get requests with a byte array created from json data. I am trying to consume this data in iOS and use NSJSONSerialization to parse it into a NSDictionary, but it fails with the following error Error…
jwilkey
  • 326
  • 3
  • 11
0
votes
1 answer

NSJSON "date" returns null

when I try my own data the NSLog for "date" returns null. Here is my json from the web page: [{"date":"2012-08-13 12:00:00","timezone_type":3,"timezone":"EST5EDT"},{"date":"2012-08-13…
TIDev
  • 109
  • 4
  • 10
0
votes
1 answer

NSJSONSerialization , Looks fine from IOS end but not escaped on Rails 3 server

Hi guys so i am using NSJSONSerialization dataWithJSONObject:jsonDict options:NSJSONWritingPrettyPrinted error:nil] command to write the json. It looks fine and when i post to the Rails server the \"first name\" is still there. Can any one…