<?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>Nick Waynik.com &#187; nick</title>
	<atom:link href="http://nickwaynik.com/author/nick/feed/" rel="self" type="application/rss+xml" />
	<link>http://nickwaynik.com</link>
	<description></description>
	<lastBuildDate>Thu, 10 May 2012 18:07:07 +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>Hide the TabBar in an iOS App</title>
		<link>http://nickwaynik.com/iphone/hide-tabbar-in-an-ios-app/</link>
		<comments>http://nickwaynik.com/iphone/hide-tabbar-in-an-ios-app/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 03:12:36 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPhoneDev]]></category>

		<guid isPermaLink="false">http://nickwaynik.com/?p=356</guid>
		<description><![CDATA[I recently came across a situation where it was useful to have a UITabBar based application, however the actual tab bar was an unnecessary item on the screen. This post is a mini tutorial on how to make this happen. Inside &#8220;application:didFinishLaunchingWithOptions:&#8221; method: tabBarController = [[UITabBarController alloc] init]; tabBarController.viewControllers = [NSArray arrayWithObjects:navController1, viewController1, viewController2, nil]; [...]]]></description>
			<content:encoded><![CDATA[<p>I recently came across a situation where it was useful to have a UITabBar based application, however the actual tab bar was an unnecessary item on the screen.  This post is a mini tutorial on how to make this happen.</p>
<p>Inside &#8220;application:didFinishLaunchingWithOptions:&#8221; method:</p>
<pre>
<code>tabBarController = [[UITabBarController alloc] init];
tabBarController.viewControllers = [NSArray arrayWithObjects:navController1, viewController1, viewController2, nil];
[window addSubview:tabBarController.view];
[self makeTabBarHidden:TRUE];</code>
</pre>
<p></p>
<p>&nbsp;</p>
<p>
Here is the &#8220;makeTabBarHidden&#8221; method:</p>
<pre>
<code>-(void)makeTabBarHidden:(BOOL)hide {
	// Custom code to hide TabBar
	if ( [tabBarController.view.subviews count] &lt; 2 ) {
		return;
	}

	UIView *contentView;

	if ( [[tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] ) {
		contentView = [tabBarController.view.subviews objectAtIndex:1];
	} else {
		contentView = [tabBarController.view.subviews objectAtIndex:0];
	}

	if (hide) {
		contentView.frame = tabBarController.view.bounds;
	}
	else {
		contentView.frame = CGRectMake(tabBarController.view.bounds.origin.x,
									   tabBarController.view.bounds.origin.y,
									   tabBarController.view.bounds.size.width,
									   tabBarController.view.bounds.size.height - tabBarController.tabBar.frame.size.height);
	}

	tabBarController.tabBar.hidden = hide;
}</code>
</pre>
<p></p>
<p>&nbsp;</p>
<p>
And you are probably wondering how to change the views that are normally controlled by the tab bar?  Here is the answer&#8230;just simply change the selectedIndex property of the tab bar.</p>
<pre>
<code>tabBarController.selectedIndex = 1;</code>
</pre>
<p></p>
<p>&nbsp;</p>
<p>
<a href="http://www.iphonedevsdk.com/forum/iphone-sdk-development/4091-uitabbarcontroller-hidden-uitabbar.html">Part of this code</a> came from a post I found on <a href="http://www.iphonedevsdk.com">iPhoneDevSDK.com</a>, so I took it one step further and made it a complete solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://nickwaynik.com/iphone/hide-tabbar-in-an-ios-app/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>iPhone 4</title>
		<link>http://nickwaynik.com/iphone/iphone-4/</link>
		<comments>http://nickwaynik.com/iphone/iphone-4/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 01:28:54 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://nickwaynik.com/?p=340</guid>
		<description><![CDATA[Some pictures from the iPhone 4 release event in Shadyside, PA.]]></description>
			<content:encoded><![CDATA[<p style="font-size: 18px;"><strong>Some pictures from the iPhone 4 release event in Shadyside, PA.</strong></p>
<p><a href="http://www.flickr.com/photos/nwaynik/4842901583/"><br />
<img src="http://farm5.static.flickr.com/4131/4842901583_4d8a845661_m.jpg" border="0" alt="iPhone 4 End of line at Shadyside" width="180" height="240" /></a> <a href="http://www.flickr.com/photos/nwaynik/4842901547/"><img src="http://farm5.static.flickr.com/4148/4842901547_3b4ed1b3ac_m.jpg" border="0" alt="iPhone 4 About to go in to the Apple Store" width="180" height="240" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nickwaynik.com/iphone/iphone-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Most Unknown Feature of Cocos2d</title>
		<link>http://nickwaynik.com/cocos2d/most-unknown-feature-of-cocos2d/</link>
		<comments>http://nickwaynik.com/cocos2d/most-unknown-feature-of-cocos2d/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 13:09:37 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[Cocos2d]]></category>

		<guid isPermaLink="false">http://nickwaynik.com/?p=336</guid>
		<description><![CDATA[The Cocos2d-iPhone website just posted an article on the samples that come with Cocos2d. This is probably THE best resource that a developer can have at their disposal. If you are using Cocos2d on the iPhone you definitely need to check out the sample code that comes with it. Here is the link to the [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.cocos2d-iphone.org/">Cocos2d-iPhone</a> website just posted an article on the samples that come with Cocos2d.  This is probably THE best resource that a developer can have at their disposal.  If you are using Cocos2d on the iPhone you definitely need to check out the sample code that comes with it.  </p>
<p>Here is the <a href="http://www.cocos2d-iphone.org/archives/663">link to the tutorial</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nickwaynik.com/cocos2d/most-unknown-feature-of-cocos2d/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CocosDenshion Sound Engine</title>
		<link>http://nickwaynik.com/iphonedev/cocosdenshion/</link>
		<comments>http://nickwaynik.com/iphonedev/cocosdenshion/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 15:04:02 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[Cocos2d]]></category>
		<category><![CDATA[iPhoneDev]]></category>

		<guid isPermaLink="false">http://nickwaynik.com/?p=326</guid>
		<description><![CDATA[Version 0.99 of Cocos2d for the iPhone was just released this week. I am using the Cocos2d framework in my game, and wanted to post a short tutorial/sample code for the CocosDenshion sound engine that is shipping with the latest version. I am going to start off with the the basic Hello World example that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cocos2d-iphone.org/archives/598">Version 0.99 of Cocos2d</a> for the iPhone was just released this week.  I am using the Cocos2d framework in my game, and wanted to post a short tutorial/sample code for the CocosDenshion sound engine that is shipping with the latest version.  </p>
<p>I am going to start off with the the basic Hello World example that is created for you when you create a new Cocos2d project.<br />
</p>
<p>&nbsp;</p>
<p>
In the HelloWorld.h file add the following lines of code to import the needed files:</p>
<pre>
<code>#import "SimpleAudioEngine.h"
#import "CocosDenshion.h"
#import "CDAudioManager.h"</code>
</pre>
<p></p>
<p>&nbsp;</p>
<p>
Now we will move to the HelloWorld.m file to add the rest of the code.  Inside the init method will will preload the background music so there is no lag when opening this layer.  Since we only have one layer, it makes no difference.  This will help when you have multiple layers in a game.  One thing to note, the backgroundMusicVolume can be set from the range of 0.0 to 1.0.  If you load a new background music file, you will need to set this again.</p>
<pre>
<code>SimpleAudioEngine *sae = [SimpleAudioEngine sharedEngine];
if (sae != nil) {
	[sae preloadBackgroundMusic:@"mario-theme.mp3"];
	if (sae.willPlayBackgroundMusic) {
		sae.backgroundMusicVolume = 0.5f;
	}
}	</code>
</pre>
<p></p>
<p>&nbsp;</p>
<p>
To play the background sound and other sounds use the following code:</p>
<pre>
<code>// Start the background music from the beginning and stop the background music
[[SimpleAudioEngine sharedEngine] playBackgroundMusic:@"mario-theme.mp3"];
[[SimpleAudioEngine sharedEngine] stopBackgroundMusic];

// Mute and unmute all sounds
[CDAudioManager sharedManager].mute = TRUE;
[CDAudioManager sharedManager].mute = FALSE;

// Pause and unpause the background music
[[SimpleAudioEngine sharedEngine] pauseBackgroundMusic];
[[SimpleAudioEngine sharedEngine] resumeBackgroundMusic];</code>
</pre>
<p></p>
<p>&nbsp;</p>
<p>
As you can see, CocosDenshion is very simple and easy to use.  More information on it can be <a href="http://www.cocos2d-iphone.org/wiki/doku.php/cocosdenshion:cookbook">found here.</a><br />
If you would like to see this in working action, then head on over to my github repository and download the sample project.<br />
<a href="http://github.com/ndubbs/CocosDenshion-Example">http://github.com/ndubbs/CocosDenshion-Example</a><br />
As always, comments are welcomed and greatly appreciated.</p>
]]></content:encoded>
			<wfw:commentRss>http://nickwaynik.com/iphonedev/cocosdenshion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DC Traffic Cams 1.1 Update</title>
		<link>http://nickwaynik.com/uncategorized/dc-traffic-cams-1-1-update/</link>
		<comments>http://nickwaynik.com/uncategorized/dc-traffic-cams-1-1-update/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 23:51:53 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nickwaynik.com/?p=324</guid>
		<description><![CDATA[The update for DC Traffic Cams was approved by Apple and is now available in the iTunes App Store. In this update, I added an error message when the traffic camera images are unavailable. I also added a brief snippet of text to the info screen explaining why the images might not be available and [...]]]></description>
			<content:encoded><![CDATA[<p>The update for DC Traffic Cams was approved by Apple and is now available in the iTunes App Store.  In this update, I added an error message when the traffic camera images are unavailable.  I also added a brief snippet of text to the info screen explaining why the images might not be available and a link to the DC Department of Transportation. </p>
<p><a href="http://itunes.com/apps/dctrafficcams">http://itunes.com/apps/dctrafficcams</a></p>
]]></content:encoded>
			<wfw:commentRss>http://nickwaynik.com/uncategorized/dc-traffic-cams-1-1-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snowstorm of Trouble</title>
		<link>http://nickwaynik.com/uncategorized/snowstorm-of-troubles/</link>
		<comments>http://nickwaynik.com/uncategorized/snowstorm-of-troubles/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 18:10:16 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nickwaynik.com/?p=320</guid>
		<description><![CDATA[The Issue: Over the past weekend I found out why I was getting bad reviews for DC Traffic Cams in the App Store. The source from where the camera images are being downloaded from was not delivering images. If you view Washington DC&#8217;s department of transportation website, they were having the same issue. I also [...]]]></description>
			<content:encoded><![CDATA[<p><strong>The Issue:</strong><br />
<br />
Over the past weekend I found out why I was getting bad reviews for DC Traffic Cams in the App Store.  The source from where the camera images are being downloaded from was not delivering images.  If you view <a href="http://app.ddot.dc.gov/services_dsf/traffic_cameras/index.asp">Washington DC&#8217;s department of transportation website</a>, they were having the same issue.  I also took a look at my competitors&#8217; apps and they fell prey to the same issue.<br />
<br />
<strong>The Big Problem:</strong><br />
<br />
I in no way shape or form was informing the app user of what was going on.  This was a big mistake on my part.  In an effort to alleviate the issue, I have been working on a solution and will be submitting an update very soon.  This will at least let the user know that the app is working but there is no image to display, versus just displaying a blank screen.  </p>
]]></content:encoded>
			<wfw:commentRss>http://nickwaynik.com/uncategorized/snowstorm-of-troubles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cocos2d Tutorial</title>
		<link>http://nickwaynik.com/uncategorized/cocos2d-tutorial/</link>
		<comments>http://nickwaynik.com/uncategorized/cocos2d-tutorial/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 21:45:01 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nickwaynik.com/?p=312</guid>
		<description><![CDATA[Over the past month, I have been looking at every tutorial and sample code that I could get my hands on regarding cocos2d on the iPhone. This past week I came across some professor&#8217;s wordpress blog for his class. One of the lectures was on cocos2d. Have a look at it. I went through the [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past month, I have been looking at every tutorial and sample code that I could get my hands on regarding cocos2d on the iPhone.  This past week I came across some professor&#8217;s wordpress blog for his class.  One of the lectures was on cocos2d.  <a href="http://cs491f09.wordpress.com/2009/12/01/lecture-25/">Have a look at it.</a> I went through the example code and used some mario graphics I found on the web to come up with my own game level.  I&#8217;m currently in the process of adding a character and some kind of control mechanism to move it around on the level (beyond the scope of the lecture).<br />
<br />
<img src="http://nickwaynik.com/blog/images/mariolevel.png" alt="Mario Level Cocos2d example" /><br />
<br />
Do you have a good website or tutorial?  Please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://nickwaynik.com/uncategorized/cocos2d-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A little bit of ASP</title>
		<link>http://nickwaynik.com/asp/a-little-bit-of-asp/</link>
		<comments>http://nickwaynik.com/asp/a-little-bit-of-asp/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 20:25:53 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[ASP]]></category>

		<guid isPermaLink="false">http://nickwaynik.com/?p=299</guid>
		<description><![CDATA[I’m taking a break from posting iPhone development code this week. At work I was implementing a cascading drop down list and ran into a few issues. You figure you could watch the tutorials on asp.net’s website and everything would work. Wrong! I am using the dropdownlist control in a form view on the aspx [...]]]></description>
			<content:encoded><![CDATA[<p>I’m taking a break from posting iPhone development code this week.  At work I was implementing a cascading drop down list and ran into a few issues.  You figure you could watch the tutorials on <a href="http://www.asp.net/learn/ajax-videos/video-278.aspx">asp.net’s website</a> and everything would work.  Wrong!  I am using the dropdownlist control in a form view on the aspx page with binding, so anytime you would submit the form it would spit out an “Invalid postback or callback argument” error.  Some suggestions posted on various web pages, blogs, and message boards say to disable EventValidation on the page.  What?  This is WRONG, WRONG, WRONG!  This will bypass all the security was built in to protect against injection attacks.  As one of my college professors would always say: “bad dog!”  </p>
<p>What you really want to do is register all of the possible values for each dropdownlist.  Where can you do this?  You have to overriding the Render sub procedure in the code behind file.  Here is sample code to fix this issue:</p>
<pre><code>Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
        If (Me.FormView1.CurrentMode = DetailsViewMode.Insert) Then
            Dim ddl1 As DropDownList = CType(Me.FormView1.FindControl("ddlDepartment"), DropDownList)
            Dim ddl2 As DropDownList = CType(Me.FormView1.FindControl("ddlEquipment"), DropDownList)

            'Load the data from the Departments table into the dropdownlist control for validation
            Dim departmentsAdapter As New DepartmentsTableAdapter
            For Each row As DataRow In departmentsAdapter.GetDepartments
                Page.ClientScript.RegisterForEventValidation(ddl1.UniqueID, _
                Trim(row("DepartmentName").ToString()))
            Next

            'Load the data from the Equipment table into the dropdownlist control for validation
            Dim equipmentAdapter As New EquipmentTableAdapter
            For Each row As DataRow In equipmentAdapter.GetAllEquipment
                Page.ClientScript.RegisterForEventValidation(ddl2.UniqueID, _
                Trim(row("EquipmentName").ToString()))
            Next
        End If

        MyBase.Render(writer)

End Sub</code></pre>
<p>I also needed to add required field validators to the drop down lists.  This will make sure the user actually selects a value.  To do this was pretty simple, you just need to set the InitialValue equal to “”.  See the sample code below:</p>
<pre><code>&lt;cc1:CascadingDropDown  ID="CascadingDropDown1"
                        runat="server"
                        Category="Department"
                        LoadingText="Loading..."
                        PromptText="Select a Department"
                        TargetControlID="ddlDepartment"
                        ServiceMethod="GetDepartments"
                        ServicePath="EquipmentService.asmx"&gt;
&lt;/cc1:CascadingDropDown&gt;
&lt;cc1:CascadingDropDown  ID="CascadingDropDown2"
                        runat="server"
                        Category="Equipment"
                        LoadingText="Loading..."
                        PromptText="Select Equipment"
                        ParentControlID="ddlDepartment"
                        TargetControlID="ddlEquipment"
                        ServiceMethod="GetEquipment"
                        ServicePath="EquipmentService.asmx"&gt;
&lt;/cc1:CascadingDropDown&gt; 

&lt;asp:DropDownList ID="ddlDepartment" runat="server"
			      SelectedValue='&lt;%# Bind("Department") %&gt;'&gt;
&lt;/asp:DropDownList&gt;

&lt;asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server"
				    ControlToValidate="ddlDepartment"
            			    InitialValue=""  ErrorMessage="Department is required"
				    Display="Dynamic" &gt;*&lt;/asp:RequiredFieldValidator&gt;

&lt;asp:DropDownList ID="ddlEquipment" runat="server" SelectedValue='&lt;%# Bind("Equipment") %&gt;'&gt;

&lt;/asp:DropDownList&gt;
&lt;asp:RequiredFieldValidator id="RequiredFieldValidator2" runat="server"
				    ControlToValidate="ddlEquipment"
        			    InitialValue=""  ErrorMessage="Department is required"
				    Display="Dynamic" &gt;*&lt;/asp:RequiredFieldValidator&gt;</code></pre>
<p>That’s it!  You now have cascading drop down lists that are fully functioning in a data bound formview.</p>
]]></content:encoded>
			<wfw:commentRss>http://nickwaynik.com/asp/a-little-bit-of-asp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check Network Connectivity</title>
		<link>http://nickwaynik.com/iphonedev/check-network-connectivity/</link>
		<comments>http://nickwaynik.com/iphonedev/check-network-connectivity/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 00:42:25 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[iPhoneDev]]></category>

		<guid isPermaLink="false">http://nickwaynik.com/?p=279</guid>
		<description><![CDATA[I figured I would put together a simple tutorial since I&#8217;ve been getting a lot of traffic based on &#8220;iPhone Human Interface Guidelines.&#8221; This is probably due to one of my earlier blog post, &#8220;Developing My First iPhone App.&#8221; I failed to adhere to the guidelines in the beginning, so my app was originally rejected. [...]]]></description>
			<content:encoded><![CDATA[<p>I figured I would put together a simple tutorial since I&#8217;ve been getting a lot of traffic based on &#8220;iPhone Human Interface Guidelines.&#8221;  This is probably due to one of my earlier blog post, &#8220;Developing My First iPhone App.&#8221;  I failed to adhere to the guidelines in the beginning, so my app was originally rejected.  Here is a simple tutorial so you don&#8217;t have the same issue as I did.<br />
</p>
<p>&nbsp;</p>
<p>
Download the Reachability project from Apple.  The link to the project is:<br />
<a href="http://developer.apple.com/iphone/library/samplecode/Reachability/index.html">http://developer.apple.com/iphone/library/samplecode/Reachability/index.html</a><br />
</p>
<p>&nbsp;</p>
<p>
The two files we will need are: Reachability.h and Reachability.m<br />
</p>
<p>&nbsp;</p>
<p>
<strong>Add SystemConiguration Framework:</strong><br />
1.  Control click (right click) on the Frameworks folder and select Add then select Existing Frameworks.<br />
2.  Scroll down and select SystemConfiguration.framework.<br />
3.  Click Add.<br />
4.  Control click (right click) on the project icon and select Add then select Existing Files.<br />
5.  Find the Classes folder in the Reachability project, and select the files Reachability.h and Reachability.m.<br />
6.  Click Add, then make sure the check box is selected for &#8220;Copy items into destination group’s folder (if needed).&#8221;<br />
7.  Click Add.</p>
<p></p>
<p>&nbsp;</p>
<p>
Inside ViewController.h file, add the following statement to the top of the header file.</p>
<pre>
<code>#import "Reachability.h"</code>
</pre>
<p></p>
<p>&nbsp;</p>
<p>
Inside the interface definition of the view controller, add the variable definitions:</p>
<pre>
<code>NSString *urlAddress;
NSURL *url;
NSURLRequest *requestObj;
NetworkStatus remoteHostStatus;
NetworkStatus internetConnectionStatus;</code>
</pre>
<p></p>
<p>&nbsp;</p>
<p>
Add the following properties:</p>
<pre>
<code>@property (nonatomic, retain) NSString *urlAddress;
@property (nonatomic, retain) NSURL *url;
@property (nonatomic, retain) NSURLRequest *requestObj;
@property NetworkStatus remoteHostStatus;
@property NetworkStatus internetConnectionStatus;</code>
</pre>
<p></p>
<p>&nbsp;</p>
<p>
Inside ViewController.m file add the synthesize statements after the implementation statement:</p>
<pre>
<code>@synthesize webView, urlAddress, url, requestObj;
@synthesize remoteHostStatus, internetConnectionStatus;</code>
</pre>
<p></p>
<p>&nbsp;</p>
<p>
Inside the viewDidLoad method, add the following lines of code to set the variables:</p>
<pre>
<code>[[Reachability sharedReachability] setAddress:@"http://www.apple.com"];
[[Reachability sharedReachability] setNetworkStatusNotificationsEnabled:YES];</code>
</pre>
<p></p>
<p>&nbsp;</p>
<p>
Inside the programming logic, use the following lines of code to test network connectivity.  Substitute the code you would like to execute where the &#8220;NSLog(@&#8221;Connection Made&#8221;)&#8221; statement is.</p>
<pre>
<code>// Query the SystemConfiguration framework for the state of the device's network connections.
self.remoteHostStatus = [[Reachability sharedReachability] remoteHostStatus];
self.internetConnectionStatus = [[Reachability sharedReachability] internetConnectionStatus];

// Check if there is a connection
if (self.internetConnectionStatus == NotReachable &amp;&amp; self.remoteHostStatus == NotReachable)
{
     UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error Loading"
                                     message:@"No Internet   Connection"
                                     delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
     [alert show];
     [alert release];
} else {
        NSLog(@"Connection Made");
}</code>
</pre>
<p></p>
<p>&nbsp;</p>
<p>
Don&#8217;t forget to clean up and add the following statements to the dealloc method.</p>
<pre>
<code>[urlAddress release];
[url release];
[requestObj release];</code>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://nickwaynik.com/iphonedev/check-network-connectivity/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Getting Started with Cocos2d</title>
		<link>http://nickwaynik.com/iphonedev/getting-started-with-cocos2d/</link>
		<comments>http://nickwaynik.com/iphonedev/getting-started-with-cocos2d/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 18:47:06 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[iPhoneDev]]></category>

		<guid isPermaLink="false">http://nickwaynik.com/?p=252</guid>
		<description><![CDATA[Step 1: Download Cocos2d from the project website. Step 2: Unzip the downloaded file in Step 1. If you are running Snow Leopard, it most likely will be in the downloads folder. Move the newly unzipped folder to the Desktop. Step 3: Open Terminal and change the directory to the cocos2d folder on the desktop. [...]]]></description>
			<content:encoded><![CDATA[<p>
<strong>Step 1:</strong> Download Cocos2d from the <a href="http://www.cocos2d-iphone.org/download">project website</a>.<br />
<br />
<strong>Step 2: </strong>Unzip the downloaded file in Step 1.  If you are running Snow Leopard, it most likely will be in the downloads folder.  Move the newly unzipped folder to the Desktop.<br />
<br />
<strong>Step 3:</strong> Open Terminal and change the directory to the cocos2d folder on the desktop.<br />
</p>
<pre>
 <code>cd desktop/cocos2d-iphone-0.8.2</code>
</pre>
<p>
<strong>Step 4:</strong> Run the install template script.<br />
</p>
<pre>
<code>./install_template.sh</code>
</pre>
<p>
The process is complete.  Startup XCode and have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://nickwaynik.com/iphonedev/getting-started-with-cocos2d/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

