<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: iPhone SDK: Parsing JSON data</title>
	<atom:link href="http://pessoal.org/blog/2008/12/12/iphone-sdk-parsing-json-data/feed/" rel="self" type="application/rss+xml" />
	<link>http://pessoal.org/blog/2008/12/12/iphone-sdk-parsing-json-data/</link>
	<description></description>
	<lastBuildDate>Fri, 02 Sep 2011 07:17:37 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Srikanth</title>
		<link>http://pessoal.org/blog/2008/12/12/iphone-sdk-parsing-json-data/comment-page-1/#comment-75750</link>
		<dc:creator>Srikanth</dc:creator>
		<pubDate>Wed, 30 Jun 2010 09:01:04 +0000</pubDate>
		<guid isPermaLink="false">http://pessoal.org/blog/?p=115#comment-75750</guid>
		<description>thanks for the answer to Mathieu&#039;s question..I was having the same problem parsing complex JSON structures..thanks!!</description>
		<content:encoded><![CDATA[<p>thanks for the answer to Mathieu&#8217;s question..I was having the same problem parsing complex JSON structures..thanks!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://pessoal.org/blog/2008/12/12/iphone-sdk-parsing-json-data/comment-page-1/#comment-65349</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Fri, 05 Feb 2010 05:38:30 +0000</pubDate>
		<guid isPermaLink="false">http://pessoal.org/blog/?p=115#comment-65349</guid>
		<description>Joao.
Thanks for the documentation. This helped me in a recent project! Hooray for JSON.</description>
		<content:encoded><![CDATA[<p>Joao.<br />
Thanks for the documentation. This helped me in a recent project! Hooray for JSON.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ondrej</title>
		<link>http://pessoal.org/blog/2008/12/12/iphone-sdk-parsing-json-data/comment-page-1/#comment-61452</link>
		<dc:creator>Ondrej</dc:creator>
		<pubDate>Thu, 17 Dec 2009 10:38:49 +0000</pubDate>
		<guid isPermaLink="false">http://pessoal.org/blog/?p=115#comment-61452</guid>
		<description>Matt: I am using categories (that&#039;s something that extends the main class u are using, in this case NSString)

.h file:

//
//  NSString+URL.h
//  urlTools
//
//  Created by Ondrej Rafaj on 19.10.09.
//  Copyright 2009 Home. All rights reserved.
//


@interface NSString (urlTools)

+ (NSString *)stringWithUrlInUtf8:(NSString *)targetUrl;

@end

.m file:

//
//  NSString+URL.m
//  urlTools
//
//  Created by Ondrej Rafaj on 19.10.09.
//  Copyright 2009 Home. All rights reserved.
//

#import &quot;NSString+URL.h&quot;


@implementation NSString (urlTools)

+ (NSString *)stringWithUrlInUtf8:(NSString *)targetUrl {
	NSLog(@&quot;URL in String: %@&quot;, targetUrl);
	NSURL *location = [NSURL URLWithString:targetUrl];
    NSError *error = nil;
	NSString *content = [NSString stringWithContentsOfURL:location encoding:NSUTF8StringEncoding error:&amp;error];
	if (error) NSLog(@&quot;Something went wrong %d, %@&quot;, [error code], [error localizedDescription]);
	return content;
}

@end


u have to import the file into the project and than just use:

NSString *data = [NSString stringWithUrlInUtf8:@&quot;http://www.example.com/your-json-file.json&quot;];

And that&#039;s it :)

I wrote a full tutorial about parsing JSON yesterday:

http://www.xprogress.com/post-44-how-to-parse-json-files-on-iphone-in-objective-c-into-nsarray-and-nsdictionary/

Cheers,

Ondrej :)</description>
		<content:encoded><![CDATA[<p>Matt: I am using categories (that&#8217;s something that extends the main class u are using, in this case NSString)</p>
<p>.h file:</p>
<p>//<br />
//  NSString+URL.h<br />
//  urlTools<br />
//<br />
//  Created by Ondrej Rafaj on 19.10.09.<br />
//  Copyright 2009 Home. All rights reserved.<br />
//</p>
<p>@interface NSString (urlTools)</p>
<p>+ (NSString *)stringWithUrlInUtf8:(NSString *)targetUrl;</p>
<p>@end</p>
<p>.m file:</p>
<p>//<br />
//  NSString+URL.m<br />
//  urlTools<br />
//<br />
//  Created by Ondrej Rafaj on 19.10.09.<br />
//  Copyright 2009 Home. All rights reserved.<br />
//</p>
<p>#import &#8220;NSString+URL.h&#8221;</p>
<p>@implementation NSString (urlTools)</p>
<p>+ (NSString *)stringWithUrlInUtf8:(NSString *)targetUrl {<br />
	NSLog(@&#8221;URL in String: %@&#8221;, targetUrl);<br />
	NSURL *location = [NSURL URLWithString:targetUrl];<br />
    NSError *error = nil;<br />
	NSString *content = [NSString stringWithContentsOfURL:location encoding:NSUTF8StringEncoding error:&amp;error];<br />
	if (error) NSLog(@&#8221;Something went wrong %d, %@&#8221;, [error code], [error localizedDescription]);<br />
	return content;<br />
}</p>
<p>@end</p>
<p>u have to import the file into the project and than just use:</p>
<p>NSString *data = [NSString stringWithUrlInUtf8:@"http://www.example.com/your-json-file.json"];</p>
<p>And that&#8217;s it :)</p>
<p>I wrote a full tutorial about parsing JSON yesterday:</p>
<p><a href="http://www.xprogress.com/post-44-how-to-parse-json-files-on-iphone-in-objective-c-into-nsarray-and-nsdictionary/" rel="nofollow">http://www.xprogress.com/post-44-how-to-parse-json-files-on-iphone-in-objective-c-into-nsarray-and-nsdictionary/</a></p>
<p>Cheers,</p>
<p>Ondrej :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andre Tozzini</title>
		<link>http://pessoal.org/blog/2008/12/12/iphone-sdk-parsing-json-data/comment-page-1/#comment-60946</link>
		<dc:creator>Andre Tozzini</dc:creator>
		<pubDate>Thu, 10 Dec 2009 20:05:34 +0000</pubDate>
		<guid isPermaLink="false">http://pessoal.org/blog/?p=115#comment-60946</guid>
		<description>Hi Joao,

Are you from Brazil or Portugal??? If so, we can speak in Portuguese maybe???

Well, i need to parse a json response from http://geocoding.cloudmade.com/144de75073a54825818c7ffada69dadd/geocoding/v2/find.js?object_type=hospital&amp;around=51.51384,-0.10952&amp;distance=2000 for example but i really don&#039;t know how to do it. What is better to use??? I need to get the coordinates from all hospitals near my gps position.

Well that it...

Thanx a lot

Best Regards

Andre Tozzini</description>
		<content:encoded><![CDATA[<p>Hi Joao,</p>
<p>Are you from Brazil or Portugal??? If so, we can speak in Portuguese maybe???</p>
<p>Well, i need to parse a json response from <a href="http://geocoding.cloudmade.com/144de75073a54825818c7ffada69dadd/geocoding/v2/find.js?object_type=hospital&amp;around=51.51384,-0.10952&amp;distance=2000" rel="nofollow">http://geocoding.cloudmade.com/144de75073a54825818c7ffada69dadd/geocoding/v2/find.js?object_type=hospital&amp;around=51.51384,-0.10952&amp;distance=2000</a> for example but i really don&#8217;t know how to do it. What is better to use??? I need to get the coordinates from all hospitals near my gps position.</p>
<p>Well that it&#8230;</p>
<p>Thanx a lot</p>
<p>Best Regards</p>
<p>Andre Tozzini</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bahar</title>
		<link>http://pessoal.org/blog/2008/12/12/iphone-sdk-parsing-json-data/comment-page-1/#comment-50210</link>
		<dc:creator>Bahar</dc:creator>
		<pubDate>Thu, 11 Jun 2009 06:58:09 +0000</pubDate>
		<guid isPermaLink="false">http://pessoal.org/blog/?p=115#comment-50210</guid>
		<description>I have developed a web service, which outputs JSON. So far I was using json-framework in fetching the web service in iphone. TouchJSON is much faster.

Thanks for sharing it.</description>
		<content:encoded><![CDATA[<p>I have developed a web service, which outputs JSON. So far I was using json-framework in fetching the web service in iphone. TouchJSON is much faster.</p>
<p>Thanks for sharing it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

