<?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: Troubleshooting NSURLConnection</title>
	<atom:link href="http://iPhoneDeveloperTips.com/networking/troubleshooting-nsurlconnection.html/feed" rel="self" type="application/rss+xml" />
	<link>http://iPhoneDeveloperTips.com/networking/troubleshooting-nsurlconnection.html</link>
	<description>Tips and Tricks for iPhone developers</description>
	<lastBuildDate>Thu, 29 Jul 2010 23:00:59 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Mark Pauley</title>
		<link>http://iPhoneDeveloperTips.com/networking/troubleshooting-nsurlconnection.html/comment-page-1#comment-207</link>
		<dc:creator>Mark Pauley</dc:creator>
		<pubDate>Wed, 04 Feb 2009 01:27:15 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=654#comment-207</guid>
		<description>Apple recommends not wrapping your fetches with NSThreads because this is pretty resource intensive (Threads have a much higher overhead than the asynchronous, NSRunloop based approach).  Most importantly is that NSURLConnection will optimally allocate sockets as well as re-use connections which should dramatically increase multiple fetches from the same host in rapid succession.  

The failure here is in the docs: 

NSURLConnection - (id)initWithRequest:(NSURLRequest *)request delegate:(id)delegate startImmediately:(BOOL)startImmediately

when passed NO for the last argument in the method will create a parked connection which you can call -start on.  The version you use is equivalent to passing YES to the last argument of the above method.

http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html#//apple_ref/occ/instm/NSURLConnection/initWithRequest:delegate:startImmediately:</description>
		<content:encoded><![CDATA[<p>Apple recommends not wrapping your fetches with NSThreads because this is pretty resource intensive (Threads have a much higher overhead than the asynchronous, NSRunloop based approach).  Most importantly is that NSURLConnection will optimally allocate sockets as well as re-use connections which should dramatically increase multiple fetches from the same host in rapid succession.  </p>
<p>The failure here is in the docs: </p>
<p>NSURLConnection &#8211; (id)initWithRequest:(NSURLRequest *)request delegate:(id)delegate startImmediately:(BOOL)startImmediately</p>
<p>when passed NO for the last argument in the method will create a parked connection which you can call -start on.  The version you use is equivalent to passing YES to the last argument of the above method.</p>
<p><a href="http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html#//apple_ref/occ/instm/NSURLConnection/initWithRequest:delegate:startImmediately" rel="nofollow">http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html#//apple_ref/occ/instm/NSURLConnection/initWithRequest:delegate:startImmediately</a>:</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian</title>
		<link>http://iPhoneDeveloperTips.com/networking/troubleshooting-nsurlconnection.html/comment-page-1#comment-121</link>
		<dc:creator>Sebastian</dc:creator>
		<pubDate>Mon, 08 Dec 2008 02:04:00 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=654#comment-121</guid>
		<description>Thanks, this post saved me a lot of time! Seems the documentation is a bit misleading here…</description>
		<content:encoded><![CDATA[<p>Thanks, this post saved me a lot of time! Seems the documentation is a bit misleading here…</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roman</title>
		<link>http://iPhoneDeveloperTips.com/networking/troubleshooting-nsurlconnection.html/comment-page-1#comment-67</link>
		<dc:creator>Roman</dc:creator>
		<pubDate>Sun, 19 Oct 2008 10:00:32 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=654#comment-67</guid>
		<description>Have you faced a problem with POST-ing images from iPhone&#039;s photo library using NSURLConnection via EDGE? My application tries to upload approximately 300Kb image data. The code works perfectly via WiFi, but connection times out when using EDGE even if timeout interval equals to 120s. Any suggestions?</description>
		<content:encoded><![CDATA[<p>Have you faced a problem with POST-ing images from iPhone&#8217;s photo library using NSURLConnection via EDGE? My application tries to upload approximately 300Kb image data. The code works perfectly via WiFi, but connection times out when using EDGE even if timeout interval equals to 120s. Any suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rodney</title>
		<link>http://iPhoneDeveloperTips.com/networking/troubleshooting-nsurlconnection.html/comment-page-1#comment-56</link>
		<dc:creator>Rodney</dc:creator>
		<pubDate>Thu, 09 Oct 2008 07:48:14 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=654#comment-56</guid>
		<description>Ok ... so here was the key.  The best way to make an async request is basically ... not to.  The most reliable approach is to wrap a synchronous request within an NSThread.  Boom .. done!</description>
		<content:encoded><![CDATA[<p>Ok &#8230; so here was the key.  The best way to make an async request is basically &#8230; not to.  The most reliable approach is to wrap a synchronous request within an NSThread.  Boom .. done!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rodney</title>
		<link>http://iPhoneDeveloperTips.com/networking/troubleshooting-nsurlconnection.html/comment-page-1#comment-55</link>
		<dc:creator>Rodney</dc:creator>
		<pubDate>Thu, 09 Oct 2008 07:10:19 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=654#comment-55</guid>
		<description>Oddly, I&#039;ve discovered a case in which an async call never gets started ... its odd.  If I can figure out what is going on I&#039;ll post again.</description>
		<content:encoded><![CDATA[<p>Oddly, I&#8217;ve discovered a case in which an async call never gets started &#8230; its odd.  If I can figure out what is going on I&#8217;ll post again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sabernar</title>
		<link>http://iPhoneDeveloperTips.com/networking/troubleshooting-nsurlconnection.html/comment-page-1#comment-54</link>
		<dc:creator>sabernar</dc:creator>
		<pubDate>Thu, 09 Oct 2008 02:27:15 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=654#comment-54</guid>
		<description>Any traction on this issue?  I&#039;m having the same problem.  I&#039;m trying to shoot off a web services call to an external service, so I&#039;m doing what you&#039;re doing above and getting the same result.  Without the [connection start] nothing happens.  Thoughts?</description>
		<content:encoded><![CDATA[<p>Any traction on this issue?  I&#8217;m having the same problem.  I&#8217;m trying to shoot off a web services call to an external service, so I&#8217;m doing what you&#8217;re doing above and getting the same result.  Without the [connection start] nothing happens.  Thoughts?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
