<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>veys.com &#187; nsurlconnection</title>
	<atom:link href="http://veys.com/tag/nsurlconnection/feed/" rel="self" type="application/rss+xml" />
	<link>http://veys.com</link>
	<description>if I only had a tagline.</description>
	<lastBuildDate>Tue, 27 Sep 2011 21:35:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>NSURLConnection + startImmediately:NO == boom?</title>
		<link>http://veys.com/2008/08/17/nsurlconnection-startimmediatelyno-boom/</link>
		<comments>http://veys.com/2008/08/17/nsurlconnection-startimmediatelyno-boom/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 00:59:47 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[nsurlconnection]]></category>
		<category><![CDATA[objective c]]></category>

		<guid isPermaLink="false">http://www.veys.com/?p=320</guid>
		<description><![CDATA[Having issues creating NSURLConnections using initWithRequest:delegate:startImmediately? NSURLConnection *c = &#91;&#91;NSURLConnection alloc&#93; initWithRequest:&#91;NSURLRequest requestWithURL:url&#93; delegate:self startImmediately:NO&#93;; Apparently when not using the simpler initWithRequest:delegate:, or even startImmediately:YES, the connection does not get scheduled in the current run loop. And again apparently, this causes unhappiness to occur when you eventually get around to calling start. Simple fix, just [...]]]></description>
			<content:encoded><![CDATA[<p>Having issues creating NSURLConnections using initWithRequest:delegate:startImmediately?</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #400080;">NSURLConnection</span> <span style="color: #002200;">*</span>c <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURLConnection</span> alloc<span style="color: #002200;">&#93;</span> initWithRequest<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURLRequest</span> requestWithURL<span style="color: #002200;">:</span>url<span style="color: #002200;">&#93;</span>
                                                     delegate<span style="color: #002200;">:</span>self
                                             startImmediately<span style="color: #002200;">:</span><span style="color: #a61390;">NO</span><span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>Apparently when not using the simpler initWithRequest:delegate:, or even startImmediately:YES, the connection does not get scheduled in the current run loop.  And again apparently, this causes unhappiness to occur when you eventually get around to calling start.</p>
<p>Simple fix, just stuff it in the current run loop before calling start and everyone gets along just fine.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span>c scheduleInRunLoop<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSRunLoop</span> currentRunLoop<span style="color: #002200;">&#93;</span> forMode<span style="color: #002200;">:</span>NSDefaultRunLoopMode<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>c start<span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>If there is something I am doing wrong or something I can do to prevent this, I&#8217;d like to know.  Alas, the API is fairly brief on NSURLConnection, I don&#8217;t think I&#8217;m missing anything.  This seems consistent with Cocoa, Cocoa Touch.</p>
]]></content:encoded>
			<wfw:commentRss>http://veys.com/2008/08/17/nsurlconnection-startimmediatelyno-boom/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  veys.com/tag/nsurlconnection/feed/ ) in 0.77601 seconds, on Feb 6th, 2012 at 9:16 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 6th, 2012 at 9:18 am UTC -->
