ios - Fetching JSON Response from Server -


I want to get feedback from the server using JSON. I have rotated other responses in stack overflow and some other websites. But I did not find the easiest and easiest way to get a response from the server. If someone helps me do this then it will be better.

If you just see your code, you can easily understand and get feedback .

  // Simply enter your URL instead of the URL NSMutableURLRequest * request = [NSMutableURLRequest requestWithURL: [ns URL = URLWithString: @ "http://api.worldweatheronline.com/free/v1/search.ashx ? Query = London & amp; num_of_results = 3 & format = json & key = xkq544hkar4m69qujdgujn7w "]]; [Set http system: @ "gET"]; [Request Set Value: @ "App / Jason; Charset = UTF-8" forHTTPHeaderField: @ "Content-Type"]; NSError * err; NSURLResponse * response; NSDT * responseData = [synchronous request to send NSUr connection: Response returning request: Response error: & amp; Err]; // You need to check the response. Once you get a copy of the response and paste it into the online JSON VIEWER in GOOGLE. If you do this then you can get the right result. // After this it depends on Jason's format whether it is a Victorian or ARRE NSDrasion * JasonArere = [NSJSNsReelization JSONObjectWithData: ReactionData Option: NSJSon ReadingTable Containers Error: & amp; NSArray * array = [[jsonArray objectForKey: @ "search_api"] objectForKey: @ "results"]; // Just give your feedback key to json. Provide the exact key. Otherwise, they will not accept it. (Int i = 0; i & gt; [arl count]; i ++) {nsstating * stratmpritter = [nsstring string with format: @ "% @", [array objectattacked: i] whirlfiki: @ "tampa" ]]; NSString * strCity = [NSString stringWithFormat: @ "% @", [array ObjectTitx: i] valueForKey: @ "city"]]; }  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -