<?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 JSON Flickr Tutorial – Part 3</title>
	<atom:link href="http://iPhoneDeveloperTips.com/networking/iphone-json-flickr-tutorial-part-3.html/feed" rel="self" type="application/rss+xml" />
	<link>http://iPhoneDeveloperTips.com/networking/iphone-json-flickr-tutorial-part-3.html</link>
	<description>iOS Developer Tips, Tricks and Tutorials.</description>
	<lastBuildDate>Wed, 08 Feb 2012 06:31:16 -0600</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: John Muchow</title>
		<link>http://iPhoneDeveloperTips.com/networking/iphone-json-flickr-tutorial-part-3.html#comment-30587</link>
		<dc:creator>John Muchow</dc:creator>
		<pubDate>Sun, 07 Nov 2010 03:08:56 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3904#comment-30587</guid>
		<description>Iain, I would look into the Flickt API and see if there is a means to insert a specific tag in the query...</description>
		<content:encoded><![CDATA[<p>Iain, I would look into the Flickt API and see if there is a means to insert a specific tag in the query&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Iain Munro</title>
		<link>http://iPhoneDeveloperTips.com/networking/iphone-json-flickr-tutorial-part-3.html#comment-30544</link>
		<dc:creator>Iain Munro</dc:creator>
		<pubDate>Sat, 06 Nov 2010 17:27:40 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3904#comment-30544</guid>
		<description>Hi John - I got it going. My Flickr key was commented out.

Is there a way to automatically put in a tag in the box or call on a specific RSS stream.

I am trying to do an App for my Cousin, where anyone can just pull in the latest photos from the wedding.

Iain</description>
		<content:encoded><![CDATA[<p>Hi John &#8211; I got it going. My Flickr key was commented out.</p>
<p>Is there a way to automatically put in a tag in the box or call on a specific RSS stream.</p>
<p>I am trying to do an App for my Cousin, where anyone can just pull in the latest photos from the wedding.</p>
<p>Iain</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mr.black</title>
		<link>http://iPhoneDeveloperTips.com/networking/iphone-json-flickr-tutorial-part-3.html#comment-30248</link>
		<dc:creator>Mr.black</dc:creator>
		<pubDate>Wed, 03 Nov 2010 16:55:55 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3904#comment-30248</guid>
		<description>Awesome!!. I really appreciate your effort!!

You are authentic guru guy!!</description>
		<content:encoded><![CDATA[<p>Awesome!!. I really appreciate your effort!!</p>
<p>You are authentic guru guy!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: twister</title>
		<link>http://iPhoneDeveloperTips.com/networking/iphone-json-flickr-tutorial-part-3.html#comment-27677</link>
		<dc:creator>twister</dc:creator>
		<pubDate>Tue, 12 Oct 2010 09:53:54 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3904#comment-27677</guid>
		<description>thanks ,,,this post is good</description>
		<content:encoded><![CDATA[<p>thanks ,,,this post is good</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dav</title>
		<link>http://iPhoneDeveloperTips.com/networking/iphone-json-flickr-tutorial-part-3.html#comment-9542</link>
		<dc:creator>Dav</dc:creator>
		<pubDate>Sat, 13 Feb 2010 06:18:43 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3904#comment-9542</guid>
		<description>Wow. It&#039;s amazing how many times after banging your head against a problem for hours, as soon as you post a question to a forum, you find the answer yourself. In fact my validator was not as picky as the Obj-C JSON parser. Some tab characters in the data file were causing the problem, I converted those to spaces and the data loads fine now!</description>
		<content:encoded><![CDATA[<p>Wow. It&#8217;s amazing how many times after banging your head against a problem for hours, as soon as you post a question to a forum, you find the answer yourself. In fact my validator was not as picky as the Obj-C JSON parser. Some tab characters in the data file were causing the problem, I converted those to spaces and the data loads fine now!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dav</title>
		<link>http://iPhoneDeveloperTips.com/networking/iphone-json-flickr-tutorial-part-3.html#comment-9541</link>
		<dc:creator>Dav</dc:creator>
		<pubDate>Sat, 13 Feb 2010 06:06:48 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3904#comment-9541</guid>
		<description>Hello,

I&#039;m having trouble figuring out what is causing an &quot;Object value expected for key: venues&quot; error when I attempt to parse a JSON file[1] in my iPhone app. I have created a schema[2] for my JSON file and it passes a check with kwalify[3] so I know the JSON itself is OK (I have found this validator is very picky). One thing that I do notice is that the JSON file in question here is by far the largest one I&#039;ve tried so far at 1.4 megs. Do you think there may be a constraint on the size of the data?

[1]: http://www.sekaino.com/skedu/demodata/sxsw.json
[2]: http://skeduapp.com/files/skedu_schema_v1.yml
[3]: http://www.kuwata-lab.com/kwalify/</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I&#8217;m having trouble figuring out what is causing an &#8220;Object value expected for key: venues&#8221; error when I attempt to parse a JSON file[1] in my iPhone app. I have created a schema[2] for my JSON file and it passes a check with kwalify[3] so I know the JSON itself is OK (I have found this validator is very picky). One thing that I do notice is that the JSON file in question here is by far the largest one I&#8217;ve tried so far at 1.4 megs. Do you think there may be a constraint on the size of the data?</p>
<p>[1]: <a href="http://www.sekaino.com/skedu/demodata/sxsw.json" rel="nofollow">http://www.sekaino.com/skedu/demodata/sxsw.json</a><br />
[2]: <a href="http://skeduapp.com/files/skedu_schema_v1.yml" rel="nofollow">http://skeduapp.com/files/skedu_schema_v1.yml</a><br />
[3]: <a href="http://www.kuwata-lab.com/kwalify/" rel="nofollow">http://www.kuwata-lab.com/kwalify/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amy Zou</title>
		<link>http://iPhoneDeveloperTips.com/networking/iphone-json-flickr-tutorial-part-3.html#comment-7330</link>
		<dc:creator>Amy Zou</dc:creator>
		<pubDate>Mon, 30 Nov 2009 06:57:31 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3904#comment-7330</guid>
		<description>After I posted my 1st comment I realized that even though the site I was calling had some funky characters, yelp still returned fine if I enter it in firefox. Do you think it&#039;s my &quot;%20&quot; between San Jose CA  down at the bottom method that is messing with everything??

The site really should have this URL: http://api.yelp.com /business_review_search?term=pizza&amp;ywsid=9udh9Zd8kh_kqoXmAPaY0g&amp; location=San%20Jose%20CA&amp;num_biz_requested=3

-(void)searchFlickrPhotos:(NSString *)term_param loc:(NSString *)location_param
{
  // Build the string to call the Flickr API
	NSString *urlString = [NSString stringWithFormat:@&quot;http://api.yelp.com/business_review_search?term=%@&amp;ywsid=%@&amp;location=%@&amp;num_biz_requested=3&quot;, term_param, YelpAPIKey, location_param];
		NSLog(urlString);
  // Create NSURL string from formatted string
	NSURL *url = [NSURL URLWithString:urlString];

  // Setup and start async download
  NSURLRequest *request = [[NSURLRequest alloc] initWithURL: url];
  NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
  [connection release];
  [request release];
    
}

/**************************************************************************
*
* Class implementation section
*
**************************************************************************/

#pragma mark -
#pragma mark Initialization

/*-------------------------------------------------------------
*
*------------------------------------------------------------*/
- (id)init
{
  if (self = [super init])
  {
    self.view = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease];

    // Initialize our arrays
		info = [[NSMutableArray alloc] init];
		reviews = [[NSMutableArray alloc] init];
		reviews1 = [[NSMutableArray alloc] init];
    
    // Notice that I am hard-coding the search tag at this point (@&quot;iPhone&quot;)    
			[self searchFlickrPhotos:@&quot;pizza&quot; loc:@&quot;San%20Jose%20CA&quot;];

  }
	return self;

}</description>
		<content:encoded><![CDATA[<p>After I posted my 1st comment I realized that even though the site I was calling had some funky characters, yelp still returned fine if I enter it in firefox. Do you think it&#8217;s my &#8220;%20&#8243; between San Jose CA  down at the bottom method that is messing with everything??</p>
<p>The site really should have this URL: <a href="http://api.yelp.com" rel="nofollow">http://api.yelp.com</a> /business_review_search?term=pizza&amp;ywsid=9udh9Zd8kh_kqoXmAPaY0g&amp; location=San%20Jose%20CA&amp;num_biz_requested=3</p>
<p>-(void)searchFlickrPhotos:(NSString *)term_param loc:(NSString *)location_param<br />
{<br />
  // Build the string to call the Flickr API<br />
	NSString *urlString = [NSString stringWithFormat:@"http://api.yelp.com/business_review_search?term=%@&amp;ywsid=%@&amp;location=%@&amp;num_biz_requested=3", term_param, YelpAPIKey, location_param];<br />
		NSLog(urlString);<br />
  // Create NSURL string from formatted string<br />
	NSURL *url = [NSURL URLWithString:urlString];</p>
<p>  // Setup and start async download<br />
  NSURLRequest *request = [[NSURLRequest alloc] initWithURL: url];<br />
  NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];<br />
  [connection release];<br />
  [request release];</p>
<p>}</p>
<p>/**************************************************************************<br />
*<br />
* Class implementation section<br />
*<br />
**************************************************************************/</p>
<p>#pragma mark -<br />
#pragma mark Initialization</p>
<p>/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
*<br />
*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*/<br />
- (id)init<br />
{<br />
  if (self = [super init])<br />
  {<br />
    self.view = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease];</p>
<p>    // Initialize our arrays<br />
		info = [[NSMutableArray alloc] init];<br />
		reviews = [[NSMutableArray alloc] init];<br />
		reviews1 = [[NSMutableArray alloc] init];</p>
<p>    // Notice that I am hard-coding the search tag at this point (@&#8221;iPhone&#8221;)<br />
			[self searchFlickrPhotos:@"pizza" loc:@"San%20Jose%20CA"];</p>
<p>  }<br />
	return self;</p>
<p>}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amy Zou</title>
		<link>http://iPhoneDeveloperTips.com/networking/iphone-json-flickr-tutorial-part-3.html#comment-7329</link>
		<dc:creator>Amy Zou</dc:creator>
		<pubDate>Mon, 30 Nov 2009 06:45:59 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3904#comment-7329</guid>
		<description>Thank you so much for doing this tutorial! 

My group&#039;s semester project is to create a iphone travel app. My part is getting yelp api to work. I downloaded part 1 &amp; just replaced only the parts I needed with the yelp api. http://www.yelp.com/developers/documentation/search_api#searchHood

However I&#039;m getting the same error as Jared did but I don&#039;t understand his solution.

The site I&#039;m calling is http://api.yelp.com/business_review_search?term=pizza&amp;ywsid=9udh9Zd8kh_kqoXmAPaY0g&amp;location=San2ose庌A&amp;num_biz_requested=3

The errors I get is: 
[Session started at 2009-11-30 00:33:39 -0600.]
2009-11-30 00:33:40.848 JSONFlickr[2518:20b] -JSONValue failed. Error trace is: (
    Error Domain=org.brautaset.JSON.ErrorDomain Code=3 UserInfo=0x571980 &quot;Object key string expected&quot;,
    Error Domain=org.brautaset.JSON.ErrorDomain Code=3 UserInfo=0x571cf0 &quot;Expected value while parsing array&quot;,
    Error Domain=org.brautaset.JSON.ErrorDomain Code=3 UserInfo=0x571da0 &quot;Object value expected for key: reviews&quot;,
    Error Domain=org.brautaset.JSON.ErrorDomain Code=3 UserInfo=0x571e60 &quot;Expected value while parsing array&quot;,
    Error Domain=org.brautaset.JSON.ErrorDomain Code=3 UserInfo=0x571ee0 &quot;Object value expected for key: businesses&quot;
)
2009-11-30 00:33:40.851 JSONFlickr[2518:20b] -JSONValue failed. Error trace is: (
    Error Domain=org.brautaset.JSON.ErrorDomain Code=3 UserInfo=0x56b830 &quot;Unrecognised leading character&quot;
)


Here is the method where I know I&#039;m not calling something right. If I  NSLog(jsonString), it prints the JSON output but it also puts the errors above in the outputs. Please help.

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 

//- (void)connectionDidFinishLoading:(NSURLConnection *)connection;
{
  // Store incoming data into a string
	NSString *jsonString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
		
  // Create a dictionary from the JSON string
	NSDictionary *results = [jsonString JSONValue];
	
  // Build an array from the dictionary for easy access to each entry
  NSArray *categories_info = [[results objectForKey:@&quot;businesses&quot;] objectForKey:@&quot;categories&quot;];
  
  // Loop through each entry in the dictionary...
	for (NSDictionary *cate in categories_info)
 {
    // Get title of the image
		NSString *name = [cate objectForKey:@&quot;name&quot;];

 debug(@&quot;name: %@&quot;, name);

}
  
}

Thanks in advance!

-Amy</description>
		<content:encoded><![CDATA[<p>Thank you so much for doing this tutorial! </p>
<p>My group&#8217;s semester project is to create a iphone travel app. My part is getting yelp api to work. I downloaded part 1 &amp; just replaced only the parts I needed with the yelp api. <a href="http://www.yelp.com/developers/documentation/search_api#searchHood" rel="nofollow">http://www.yelp.com/developers/documentation/search_api#searchHood</a></p>
<p>However I&#8217;m getting the same error as Jared did but I don&#8217;t understand his solution.</p>
<p>The site I&#8217;m calling is <a href="http://api.yelp.com/business_review_search?term=pizza&#038;ywsid=9udh9Zd8kh_kqoXmAPaY0g&#038;location=San2ose庌A&#038;num_biz_requested=3" rel="nofollow">http://api.yelp.com/business_review_search?term=pizza&#038;ywsid=9udh9Zd8kh_kqoXmAPaY0g&#038;location=San2ose庌A&#038;num_biz_requested=3</a></p>
<p>The errors I get is:<br />
[Session started at 2009-11-30 00:33:39 -0600.]<br />
2009-11-30 00:33:40.848 JSONFlickr[2518:20b] -JSONValue failed. Error trace is: (<br />
    Error Domain=org.brautaset.JSON.ErrorDomain Code=3 UserInfo=0&#215;571980 &#8220;Object key string expected&#8221;,<br />
    Error Domain=org.brautaset.JSON.ErrorDomain Code=3 UserInfo=0x571cf0 &#8220;Expected value while parsing array&#8221;,<br />
    Error Domain=org.brautaset.JSON.ErrorDomain Code=3 UserInfo=0x571da0 &#8220;Object value expected for key: reviews&#8221;,<br />
    Error Domain=org.brautaset.JSON.ErrorDomain Code=3 UserInfo=0x571e60 &#8220;Expected value while parsing array&#8221;,<br />
    Error Domain=org.brautaset.JSON.ErrorDomain Code=3 UserInfo=0x571ee0 &#8220;Object value expected for key: businesses&#8221;<br />
)<br />
2009-11-30 00:33:40.851 JSONFlickr[2518:20b] -JSONValue failed. Error trace is: (<br />
    Error Domain=org.brautaset.JSON.ErrorDomain Code=3 UserInfo=0x56b830 &#8220;Unrecognised leading character&#8221;<br />
)</p>
<p>Here is the method where I know I&#8217;m not calling something right. If I  NSLog(jsonString), it prints the JSON output but it also puts the errors above in the outputs. Please help.</p>
<p>- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data </p>
<p>//- (void)connectionDidFinishLoading:(NSURLConnection *)connection;<br />
{<br />
  // Store incoming data into a string<br />
	NSString *jsonString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];</p>
<p>  // Create a dictionary from the JSON string<br />
	NSDictionary *results = [jsonString JSONValue];</p>
<p>  // Build an array from the dictionary for easy access to each entry<br />
  NSArray *categories_info = [[results objectForKey:@"businesses"] objectForKey:@&#8221;categories&#8221;];</p>
<p>  // Loop through each entry in the dictionary&#8230;<br />
	for (NSDictionary *cate in categories_info)<br />
 {<br />
    // Get title of the image<br />
		NSString *name = [cate objectForKey:@"name"];</p>
<p> debug(@&#8221;name: %@&#8221;, name);</p>
<p>}</p>
<p>}</p>
<p>Thanks in advance!</p>
<p>-Amy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stig Brautaset</title>
		<link>http://iPhoneDeveloperTips.com/networking/iphone-json-flickr-tutorial-part-3.html#comment-6852</link>
		<dc:creator>Stig Brautaset</dc:creator>
		<pubDate>Thu, 19 Nov 2009 07:22:46 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3904#comment-6852</guid>
		<description>Steve,

Your question is more about Objective-C than the JSON.framework itself. The parser will translate JSON types into Objective-C types in the way described here: http://json-framework.googlecode.com/svn/branches/2.2/documentation/interfaceSBJsonParser.html#_details

You will get a dictionary (or, in some cases, an array) back from the parser. If something is an integer in the JSON text, then you can get its value back like this:

NSNumber tmp = [jsonResult objectForKey:@&quot;farm&quot;];
NSInteger farm = [tmp integerValue];

Or in one line:

NSInteger farm = [[jsonResult objectForKey:@&quot;farm&quot;] integerValue];</description>
		<content:encoded><![CDATA[<p>Steve,</p>
<p>Your question is more about Objective-C than the JSON.framework itself. The parser will translate JSON types into Objective-C types in the way described here: <a href="http://json-framework.googlecode.com/svn/branches/2.2/documentation/interfaceSBJsonParser.html#_details" rel="nofollow">http://json-framework.googlecode.com/svn/branches/2.2/documentation/interfaceSBJsonParser.html#_details</a></p>
<p>You will get a dictionary (or, in some cases, an array) back from the parser. If something is an integer in the JSON text, then you can get its value back like this:</p>
<p>NSNumber tmp = [jsonResult objectForKey:@"farm"];<br />
NSInteger farm = [tmp integerValue];</p>
<p>Or in one line:</p>
<p>NSInteger farm = [[jsonResult objectForKey:@"farm"] integerValue];</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: steve</title>
		<link>http://iPhoneDeveloperTips.com/networking/iphone-json-flickr-tutorial-part-3.html#comment-6846</link>
		<dc:creator>steve</dc:creator>
		<pubDate>Thu, 19 Nov 2009 03:08:34 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3904#comment-6846</guid>
		<description>Hi, John, your tutorial is awesome!
I have a question for JSON parser:  how can we parse the field which are NON String? for example, integer, boolean, or float type. It seems in your flicker example, everything is treated as NSString, like farm,   in the returned son data, it&#039;s type is integer, but in your code you treated it as NSString.
Can we get the value of integer directly using JSON API? like:

int farm = JsonResult.getInteger(@&quot;farm&quot;);

Thanks</description>
		<content:encoded><![CDATA[<p>Hi, John, your tutorial is awesome!<br />
I have a question for JSON parser:  how can we parse the field which are NON String? for example, integer, boolean, or float type. It seems in your flicker example, everything is treated as NSString, like farm,   in the returned son data, it&#8217;s type is integer, but in your code you treated it as NSString.<br />
Can we get the value of integer directly using JSON API? like:</p>
<p>int farm = JsonResult.getInteger(@&#8221;farm&#8221;);</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>

