nsjsonserialization Questions

6

Solved

Upgrading to UrbanAirship 3.0.0 with Xcode 5.0, I'm getting an error when calling this code: [UAirship takeOff:config]; The error is +[NSJSONSerialization stringWithObject:]: unrecognized selec...
Footstool asked 19/9, 2013 at 14:12

11

Solved

Hello I a class of type NSObject: ProductDetails *details = [[ProductDetails alloc] init]; details.name = @"Soap1"; details.color = @"Red"; details.quantity = 4; I want to pass the "details" obj...
Proudlove asked 29/9, 2013 at 15:39

35

Solved

I'm really struggling with trying to read a JSON file into Swift so I can play around with it. I've spent the best part of 2 days re-searching and trying different methods but no luck as of yet so ...
Incommensurable asked 25/6, 2014 at 14:4

10

Solved

I want to make one function in my swift project that converts String to Dictionary json format but I got one error: Cannot convert expression's type (@lvalue NSData,options:IntegerLitralConverti...
Nomism asked 27/5, 2015 at 11:5

5

Solved

I have a JObject which is used as a template for calling RESTful web services. This JObject gets created via a parser and since it's used as a template telling the user what the endpoint schema loo...
Lim asked 8/10, 2015 at 23:9

7

Solved

I have a Swift struct like this. struct Usage { var totalData: Double var remainingTotalData: Double init(jsonData: NSData) { var jsonDict = [String: AnyObject]() do { jsonDict = try NSJSO...
Hierarch asked 23/10, 2015 at 9:37

2

Solved

I have a dictionary that when I log it shows... { Date = "2013-04-30 17:17:18 +0000"; Description = Kb; EventID = "92193e58-c04a-4233-9a6c-1332bc056b20"; Title = Keyboard; } I'm trying to tu...
Kinchinjunga asked 30/4, 2013 at 17:23

4

Solved

I created a struct and want to save it as a JSON-file. struct Sentence { var sentence = "" var lang = "" } var s = Sentence() s.sentence = "Hello world" s.lang = "en" print(s) ...which result...
Pen asked 17/10, 2015 at 11:23

4

I have problems with some public json services with serveices formatted this way jsonFlickrFeed({ "title": "Uploads from everyone", "link": "http://www.flickr.com/photos/", "description": "",...
Cummings asked 30/12, 2011 at 22:26

3

Solved

I am trying to convert some simple HTML into a string value in a JSON object and I'm having trouble getting the string encoding to not escape the string in NSJSONSerialization. Example... I have a...
Military asked 3/4, 2013 at 17:55

5

Solved

How do I prevent NSJSONSerialization from adding extra backslashes to my URL strings? NSDictionary *info = @{@"myURL":@"http://www.example.com/test"}; NSData data = [NSJSONSerialization dataWithJS...
Cerotype asked 29/10, 2013 at 6:14

5

After spending too much time trying to find the best practices, here I am once again asking for some help, hoping I am not the only one struggling with this : I have NSManaged Objects like these :...
Lindgren asked 28/7, 2015 at 9:36

4

Solved

I think I get it how to use the NSJSONSerialization over all. The call I am making is: [NSJSONSerialization dataWithJSONObject:parameters options:0 error:&error] where parameters is a NSDic...
Sextain asked 17/12, 2012 at 3:57

3

Solved

I have response string from the backend like this: { "status": "success", "data": "{\"name\":\"asd\",\"address\":\"Street 1st\"}" } I think the problem was because the double quote (") in the ...
Hecht asked 16/5, 2018 at 8:9

1

I am developing an iOS app, using swift 4.0 (4.2 has the same issue). I added an extension to Encodable extension Encodable{ func toDict() throws -> [String:Any]? { let jsonEncoder = JSONE...
Perla asked 17/1, 2019 at 11:6

2

Executing NSJSONSerialization on the following json sometimes gives me NSCFString* and sometimes NSTaggedPointerString* on string values. Does anyone know why this is the case and what NSJSONSerial...
Naval asked 13/10, 2015 at 14:47

2

Solved

TL;DR Is there a way that I can use JSONDecoder and write a function which will just read out from given json given field value of specified decodable type? Imaging I have the following json: ...
Immobilize asked 9/12, 2018 at 22:19

6

Solved

NSData* jsonDataToSendTheServer; NSDictionary *setUser = [NSDictionary dictionaryWithObjectsAndKeys:[@"u" stringByAppendingString:my.id],@"id", @"GET_USER_INFO",@"command", @"",@"value", nil];...
Gennie asked 13/8, 2012 at 10:52

3

Solved

I'm trying to create a simple JSON object but I still get error and I know what's wrong in my code: NSString *vCard = [BRContacts getContacts]; // this is just a string, could be nil NSDictionary ...
Pyrogenous asked 10/12, 2015 at 15:32

5

Solved

i want to convert NSDictionary to json string.everything is working fine, i have a small issue that is described as follows: I have a following code for conversion of NSDictionary to NSString: -(N...
Stanzel asked 21/11, 2014 at 4:53

1

Solved

First, I know nothing about Objective-C. That said the follow code should be getting the data from AsyncStorage. I've already did something like for Android where the basic idea is get the data f...
Octaviaoctavian asked 12/1, 2018 at 19:22

4

Solved

We often want to use JSON for human readability. As such, it is common to ask to sort the JSON keys alphabetically (or alphanumerically) in Go, in .NET, in Python, in Java, ... But how to output a...
Intervale asked 4/9, 2017 at 7:43

1

Solved

I'm trying to make a post request with the following dictionary which is converted to JSON let store = [ "newTask" : [ "project_name": "iOS", "total_time":0, "color":"blue" ] ] I am seria...
Oxidase asked 5/6, 2017 at 11:35

1

I am stuck at a point when I convert data from web services to NSDictionary. But while accessing on console in debug mode it returns , while when i bind the values of dictionary with view it works ...
Odetteodeum asked 2/12, 2016 at 3:33

2

I'm using NSJSONSerialization to convert json string to NSDictionaray the JSON string is {"bid":88.667,"ask":88.704} after NSJSONSerialization { ask = "88.70399999999999"; bid = "88.667"; }...
Cresting asked 6/5, 2014 at 0:17

© 2022 - 2024 — McMap. All rights reserved.