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

NSJSONSerialization error

I'm trying to send json object to server. But I received an error and I can't fix it. -(void) connectToHost{ CFReadStreamRef readStream; CFWriteStreamRef writeStream; CFStreamCreatePairWithSocketToHost(NULL, (CFStringRef)@"localhost", 9123,…
meth
  • 1,887
  • 2
  • 18
  • 33
-1
votes
1 answer

Parsing JSON in Objective C (iOS)

I have a problem parsing JSON string in Objective C: My JSON: {"messages":[{"nick":"Tim","message":"Hallo","time":"06.07.2012 13:26:41"}]} My Objective C Code: NSError *error = nil; NSData *data = [NSData dataWithContentsOfURL:@"..URL.."]; NSArray…
-1
votes
3 answers

How to display JSON array on UITableView

JSON data is something like that... {"order_list_1":[ {"name":"@SEVEN (7) OCLOCK BLADE PLATINUM","qty":1,"mrp":0.0}, {"name":"ACT 2 POPCORN BUTTER PEPPER","qty":2,"mrp":0.0}, {"name":"ACT 2 POPCORN CHILLY…
-2
votes
1 answer

remove double quotes in array from json response swift

I am making a url call with Alamofire to GET data as below. In first step I convert JSON array to this format ["a", "b", "b", "c"] and its work correctly. The question it is _price variable is like this ["1233", "1333","3422","2422"] But i…
-2
votes
2 answers

JSON Parsing---> Could not cast value of type '__NSCFString' (0x1e5c38f90) to 'NSDictionary' (0x1e5c39bc0)

{"msgType":"UPDATE_S","macAddress":"2F-01-01-01-01-01","deviceName":"vMining","deviceType":"vSensor","groupId":"vMiningYo","param”:”truckDetail","value":"[{'TruckNo':1,'Status':'Moving to…
Yoom
  • 27
  • 5
-2
votes
2 answers

JSON String to Dictionary in Swift 4

I'm getting response from server in JSON in this…
Rohitax Rajguru
  • 893
  • 2
  • 13
  • 35
-2
votes
1 answer

Json response gets only last row in swift

hi i am trying to get the son response from the server and the following is the response i get from server while using postman { "stories": [ { "image_url": "http://storybox.dk/wp-content/uploads/2016/11/Hansa.jpg", "name": "New story", …
Mohanraj
  • 587
  • 4
  • 21
-2
votes
1 answer

Parse JSON in Objective-C from REST API

I am facing an issue when trying to parse this sample JSON coming from a REST API using NSJSONSerialization. I am using option NSJSONReadingallowfragment but it's not getting converted to JSON, it is still in NSString. Error: "unrecognized selector…
-2
votes
2 answers

Is it right about JSON

I have a question about KNilOptions and NSJSONReadingMutableContainers. i thank they have a same function. Because KNilOptions Equal to Zero and NSJSONReadingMutableContainers too. is it right? NSDictionary * dict = [NSJSONSerialization…
sixleaves
  • 9
  • 2
-2
votes
2 answers

How to Parse Json with NSJSONSerialization from NSString

I am using NSURLSession and NSURLSessionDataTask to send a post request and then get the response and store it in a variable that is an NSString and then log it. My function right now looks like this: NSURLSessionConfiguration *defaultConfigObject…
RedShirt
  • 855
  • 2
  • 20
  • 33
-2
votes
1 answer

JSON Parsing Issue

Hello I am new to iOS development. I am trying to parse a JSON response. Below is the top part of the response: Table = { Rows = { results = ( { Cells = { results = ( { …
user3037815
  • 93
  • 1
  • 1
  • 4
-2
votes
1 answer

How to Serialize Object into JSON in Objective C?

I have a Class as follows Class1 *obj = [[Class1 alloc] init]; obj.id=1; obj.Name=@"aaa"; obj.Marks=100; I am adding this to NSMutableDictionary as follows NSMutableDictionary* dict=[[NSMutableDictionary alloc]initWithCapacity:10]; [dict…
-2
votes
2 answers

How to get JSON element within another JSON element in Objective-C

I have a JSON document like so: { dates = { 01 = { date = "01-07-2013"; prayers = { Asr = "5:33"; Dhuhr = "1:10"; Fajr = "2:38"; …
samiles
  • 3,768
  • 12
  • 44
  • 71
-2
votes
2 answers

Cant get data from nsdictionary of json with objectforkeys

I'm getting a json in a NSDictionary. I am watching this json if I do a NSLog of the NSDictionary. NSLog->> {"login":{"pass":"yeeply123","user":"Yeeply"}} I get places dictionary here: - (void)connectionDidFinishLoading:(NSURLConnection…
roxeman3
  • 147
  • 1
  • 3
  • 12
-2
votes
1 answer

How to send & receive data from ios application with JSON

Hi i am not very much familiar to iOS programming , i am making an application that will interact with web (php). I need to know how to send & receive the data from web using JSON ?