<?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>iPhone Developer &#187; Reachability</title>
	<atom:link href="http://iphonedeveloper.co.nz/tag/reachability/feed/" rel="self" type="application/rss+xml" />
	<link>http://iphonedeveloper.co.nz</link>
	<description>Developing Native &#38; Webapps</description>
	<lastBuildDate>Mon, 07 Dec 2009 20:01:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>NZRSS status update</title>
		<link>http://iphonedeveloper.co.nz/2009/11/nzrss-status-update/</link>
		<comments>http://iphonedeveloper.co.nz/2009/11/nzrss-status-update/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 23:15:32 +0000</pubDate>
		<dc:creator>Jarrad Edwards</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[NZRSS]]></category>
		<category><![CDATA[Reachability]]></category>
		<category><![CDATA[UIWebView]]></category>

		<guid isPermaLink="false">http://iphonedeveloper.co.nz/?p=25</guid>
		<description><![CDATA[I haven&#8217;t been doing much development in the past week due to an internal flash viral campaign (more about this at bottom of post), however we did receive some feedback on the NZRSS. Firstly one mistake I had missed in the new RSS reader was the &#8220;Reachability&#8221;, as this app relies on an active network [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t been doing much development in the past week due to an internal flash viral campaign (more about this at bottom of post), however we did receive some feedback on the NZRSS.<br />
<span id="more-25"></span><br />
Firstly one mistake I had missed in the new RSS reader was the &#8220;Reachability&#8221;, as this app relies on an active network connection in order to work&#8230; Oops! <img src='http://iphonedeveloper.co.nz/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> , this is pretty simple however, for a sample source see the apple developer website <a href="http://developer.apple.com/iphone/library/samplecode/Reachability/index.html" target="_blank">here</a></p>
<p>In my case, this is really quite simple to implement, as I only need to check for the connection on the app launch, I included both Reachability.h &#038; Reachability.m into my project, and import Reachability.h into my AppDelegate, and check it via the method below:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span>void<span style="color: #009900;">&#41;</span>applicationDidFinishLaunching<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>UIApplication <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>application <span style="color: #009900;">&#123;</span>
	NetworkStatus internetConnectionStatus <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#91;</span>Reachability sharedReachability<span style="color: #009900;">&#93;</span> internetConnectionStatus<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>internetConnectionStatus <span style="color: #339933;">==</span> NotReachable<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// no connection</span>
		UIImageView <span style="color: #339933;">*</span>noConnection <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#91;</span>UIImageView alloc<span style="color: #009900;">&#93;</span> initWithImage<span style="color: #339933;">:</span><span style="color: #009900;">&#91;</span>UIImage imageNamed<span style="color: #339933;">:@</span><span style="color: #0000ff;">&quot;noNetwork.png&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#91;</span>window addSubview<span style="color: #339933;">:</span>noConnection<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#91;</span>noConnection release<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// connection, continue normally</span>
		<span style="color: #009900;">&#91;</span>window addSubview<span style="color: #339933;">:</span><span style="color: #009900;">&#91;</span>navBarController view<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#91;</span>window makeKeyAndVisible<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The second thing wrong with the NZRSS was something so small I wet myself laughing, on my Article view I had created a menu (as mentioned in the previous post), in that menu if the article has a &#8220;full article&#8221; link, I showed a Safari button, thats right a &#8220;Safari&#8221; icon, the apple do not approve the use of this (is it just me or is the UIWebView not safari? LOL), anyways, I found a new icon for this, and fixed that issue (also renamed it to WWW).</p>
<p>Sooo what does this mean? yep another week or two to get it approved, back to the waiting game (Or should I say, back to working on my game while waiting for the approval).</p>
<p>Flash Viral Link: <a href="http://www.taurangawebsite.co.nz" target="_blank">Tauranga Websites</a></p>
<p>Ok so this week i have been busy working on this internal viral, this is a piece of advertising we are trialing to help increase the website development Totali does, this was rushed, and not too well thought out, but in the end I am still happy with the outcome in the amount of time available.</p>
<p>This is a simple flash game, which is interactive on a couple of levels, firstly it requires the user to input a name and phone number, from here you will receive a call from our automated phone service with instructions on how to play the game.</p>
<p>After this is complete the game starts, you simply have to shoot the twitter birds, get as many twitter birds as you can in 60 seconds to claim your discount voucher for our &#8220;Spring into Action&#8221; website promotion.</p>
<p>Note(s): The more birds you get, the bigger the discount. This is set up to only call NZ phone numbers</p>
]]></content:encoded>
			<wfw:commentRss>http://iphonedeveloper.co.nz/2009/11/nzrss-status-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

