Skip to main content

All Questions

Tagged with
104 votes
6 answers
137k views

iPhone/iOS JSON parsing tutorial [closed]

As a learning experience, I want to make an iPhone application that calls a webserver/webservice, retrieves a JSON response, and uses that response to populate the rows of a UITableView (assuming it ...
Casey Flynn's user avatar
161 votes
12 answers
229k views

How to use NSJSONSerialization

I have a JSON string (from PHP's json_encode() that looks like this: [{"id": "1", "name":"Aaa"}, {"id": "2", "name":"Bbb"}] I want to parse this into some sort of data structure for my iPhone app. I ...
Logan Serman's user avatar
  • 29.8k
169 votes
14 answers
110k views

Swift 3 URLSession.shared() Ambiguous reference to member 'dataTask(with:completionHandler:) error (bug)

Hello I have working json parsing code for swift2.2 but when i use it for Swift 3.0 gives me that error ViewController.swift:132:31: Ambiguous reference to member 'dataTask(with:completionHandler:)' ...
SwiftDeveloper's user avatar
358 votes
14 answers
317k views

Generate JSON string from NSDictionary in iOS

I have a dictionary I need to generate a JSON string by using dictionary. Is it possible to convert it? Can you guys please help on this?
Sekhar Bhetalam's user avatar
138 votes
14 answers
228k views

How to parse JSON response from Alamofire API in Swift?

Following code I have written and I am getting response in JSON also but the type of JSON is "AnyObject" and I am not able to convert that into Array so that I can use that. Alamofire.request(.POST, "...
Developer's user avatar
  • 6,445
38 votes
3 answers
85k views

Cocoa error 3840 using JSON (iOS)

I'm trying to send data to a server and receive the response in JSON format. The problem is that the server has to return "success" or "fail" but it returns "(null)". Here's the returned error: ...
iosdevrocks's user avatar
  • 1,035
39 votes
1 answer
61k views

Type 'Any' Has no Subscript Members in xcode 8 Swift 3 [duplicate]

My App is supposed to go to a specific location to pull down the website it needs to load. In 2.3 it worked like a charm, but since I've updated xcode (which I don't have a ton of experience in) it is ...
DaVinci1223's user avatar
80 votes
12 answers
151k views

Convert array to JSON string in swift

How do you convert an array to a JSON string in swift? Basically I have a textfield with a button embedded in it. When button is pressed, the textfield text is added unto the testArray. Furthermore, I ...
DrPatience's user avatar
  • 1,776
158 votes
5 answers
158k views

How do I deserialize a JSON string into an NSDictionary? (For iOS 5+)

In my iOS 5 app, I have an NSString that contains a JSON string. I would like to deserialize that JSON string representation into a native NSDictionary object. "{\"password\" : \"1234\", \"user\" : ...
Andreas's user avatar
  • 167
11 votes
1 answer
2k views

Foreign key relationship mapping with RestKit

I'm totally new to RestKit and am struggling somewhat. JSON: { "teams": [ { "id": 1, "name": "Team A" }, { "id": 2, "name":...
Camsoft's user avatar
  • 12k
114 votes
17 answers
203k views

Simple and clean way to convert JSON string to Object in Swift

I have been searching for days to convert a fairly simple JSON string to an object type in Swift but with no avail. Here is the code for web service call: func GetAllBusiness() { Alamofire....
Hasan Nizamani's user avatar
40 votes
5 answers
43k views

Native JSON support in iOS?

Is there a class to parse JSON from a server in the iOS SDK? (similar to NSXML for XML and by extension RSS.)
Moshe's user avatar
  • 58k
10 votes
3 answers
13k views

iOS: Serialize/Deserialize complex JSON generically from NSObject class

Anyone have idea how to serialize nested JSON based on NSObject class? There is a discussion to serialize simple JSON here , but it is not generic enough to cater complex nested JSON. Imagine this ...
Alphapico's user avatar
  • 3,033
0 votes
2 answers
2k views

Parsing nested Array of Dictionaries using Object Mapper

I am parsing a web api response which is an array of dictionaries. Each dictionary in turn has a nested array of dictionaries. How do i parse it? Pl provide with some code sample. My api response is, ...
Mano's user avatar
  • 730
27 votes
4 answers
72k views

Post data in Objective C using Json

I am trying to post data to a PHP web service. I am familiar doing this in html using query $.post but I am very much stumped trying this in objective C. I tried several blogs & questions found on ...
Praneeta's user avatar
  • 1,594

15 30 50 per page
1
2 3 4 5
52