<?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>The Tutorial Blog &#187; objc</title>
	<atom:link href="http://www.thetutorialblog.com/tag/objc/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thetutorialblog.com</link>
	<description></description>
	<lastBuildDate>Tue, 08 Nov 2011 19:21:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<image>
<link>http://www.thetutorialblog.com</link>
<url>http://www.thetutorialblog.com/wp-content/plugins/maxblogpress-favicon/icons/favicon-28.ico</url>
<title>The Tutorial Blog</title>
</image>
		<item>
		<title>Creating a basic iPad application</title>
		<link>http://www.thetutorialblog.com/cocoa-objective-c/creating-a-basic-ipad-application/</link>
		<comments>http://www.thetutorialblog.com/cocoa-objective-c/creating-a-basic-ipad-application/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 18:47:44 +0000</pubDate>
		<dc:creator>Wez Pyke</dc:creator>
				<category><![CDATA[Cocoa/Objective-C]]></category>
		<category><![CDATA[Text Tutorials]]></category>
		<category><![CDATA[basic tutorial]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[create]]></category>
		<category><![CDATA[create a basic iPad application]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[ipad app]]></category>
		<category><![CDATA[objc]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[UIKit]]></category>

		<guid isPermaLink="false">http://www.thetutorialblog.com/?p=287</guid>
		<description><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	Because of the recent announcement of the iPad 2 more people are going to want to learn how to develop for the iPhone OS. I recently purchased an iPad 2 3G with o2, so far the broadband has been flawless. This tutorial will be a basic walk-through for beginners who want to start developing. The [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fcocoa-objective-c%2Fcreating-a-basic-ipad-application%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fcocoa-objective-c%2Fcreating-a-basic-ipad-application%2F&amp;source=wezpyke&amp;style=normal&amp;service=bit.ly" height="61" width="50" title="Creating a basic iPad application" alt=" Creating a basic iPad application" /><br />
			</a>
		</div>
<p><img class="alignleft size-full wp-image-292" title="ipad" src="http://www.thetutorialblog.com/wp-content/uploads/2010/02/ipad.jpg" alt="ipad Creating a basic iPad application" width="450" height="338" /><br />
Because of the recent announcement of the <a href="http://www.apple.com/ipad/">iPad 2</a> more people are going to want to learn how to develop for the <a href="http://en.wikipedia.org/wiki/IPhone_OS">iPhone OS</a>. I recently purchased an iPad 2 3G with <a href="http://www.o2.co.uk/">o2</a>, so far the broadband has been flawless.</p>
<p>This tutorial will be a basic walk-through for beginners who want to start developing.</p>
<p>The application that we will be creating will consist of two button and one label.<br />
<span id="more-287"></span></p>
<h2>Create a new project</h2>
<p>First of all open Xcode and click "Create a new Xcode project". Select View-based Application and then iPad as the product.<br />
<img class="alignleft size-full wp-image-288" title="screenshot1" src="http://www.thetutorialblog.com/wp-content/uploads/2010/02/screenshot1.jpg" alt="screenshot1 Creating a basic iPad application" width="650" height="499" /></p>
<p>Save the project as Tutorial.</p>
<h2>Outlets and Actions</h2>
<p>For things such as labels and textfields we use IBOutlets and for buttons we use IBActions. IB stands for Interface Builder and is what we will use to create our interface and link the connections.</p>
<p>To add our outlets and actions open up TutorialViewController.h.</p>
<p>Under @interface TutorialViewController : UIViewController { add:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">IBOutlet UILabel <span style="color: #339933;">*</span>currentNumber<span style="color: #339933;">;</span></pre></div></div>

<p>Then before @end add:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">-</span><span style="color: #009900;">&#40;</span>IBAction<span style="color: #009900;">&#41;</span>incrementNumber<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span>sender<span style="color: #339933;">;</span>
<span style="color: #339933;">-</span><span style="color: #009900;">&#40;</span>IBAction<span style="color: #009900;">&#41;</span>decrementNumber<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span>sender<span style="color: #339933;">;</span></pre></div></div>

<p>Save TutorialViewController.h.</p>
<h2>Create the interface and make connections</h2>
<p>Open up TutorialViewController.xib. From the library drag one labels and two buttons.<br />
<img class="alignleft size-full wp-image-289" title="screenshot2" src="http://www.thetutorialblog.com/wp-content/uploads/2010/02/screenshot2.jpg" alt="screenshot2 Creating a basic iPad application" width="650" height="510" /></p>
<p>Control + click the File's Owner object and drag it to the label then select currentNumber; now go from the minus and plus button to the File's Owner object and select decrementNumber for the minus button and incrementNumber for the plus button.<br />
<img class="alignleft size-full wp-image-290" title="screenshot3" src="http://www.thetutorialblog.com/wp-content/uploads/2010/02/screenshot3.jpg" alt="screenshot3 Creating a basic iPad application" width="650" height="432" /></p>
<p>Save TutorialViewController.xib and close Interface Builder.</p>
<h2>The Code</h2>
<p>Open TutorialViewController.m. Below the implementation we need to create an integer called number and set the value to 0.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> number <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span></pre></div></div>

<p>We now need to create methods for when the increment and decrement buttons are pressed.<br />
When the increment button is pressed we will increment the number integer by 1 then set the value of currentNumber to number by using a formatted string.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">-</span><span style="color: #009900;">&#40;</span>IBAction<span style="color: #009900;">&#41;</span>incrementNumber<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span>sender <span style="color: #009900;">&#123;</span>
	number<span style="color: #339933;">++;</span>
	<span style="color: #009900;">&#91;</span>currentNumber setText<span style="color: #339933;">:</span><span style="color: #009900;">&#91;</span>NSString stringWithFormat<span style="color: #339933;">:</span>@<span style="color: #ff0000;">&quot;%d&quot;</span><span style="color: #339933;">,</span> number<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>and for decrement its the same but we decrement the number integer by 1.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">-</span><span style="color: #009900;">&#40;</span>IBAction<span style="color: #009900;">&#41;</span>decrementNumber<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span>sender <span style="color: #009900;">&#123;</span>
	number<span style="color: #339933;">-;</span>
	<span style="color: #009900;">&#91;</span>currentNumber setText<span style="color: #339933;">:</span><span style="color: #009900;">&#91;</span>NSString stringWithFormat<span style="color: #339933;">:</span>@<span style="color: #ff0000;">&quot;%d&quot;</span><span style="color: #339933;">,</span> number<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h2>Build and Run</h2>
<p>Press the Build and Run button (command + return) and your app will compile then open.<br />
<img class="alignleft size-full wp-image-291" title="screenshot4" src="http://www.thetutorialblog.com/wp-content/uploads/2010/02/screenshot4.jpg" alt="screenshot4 Creating a basic iPad application" width="650" height="503" /></p>
<h2>Download</h2>
<p><a href="http://bit.ly/9Kqaok">Download</a></p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thetutorialblog.com/cocoa-objective-c/creating-a-basic-ipad-application/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Basic iPhone Button</title>
		<link>http://www.thetutorialblog.com/cocoa-objective-c/basic-iphone-button/</link>
		<comments>http://www.thetutorialblog.com/cocoa-objective-c/basic-iphone-button/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 00:35:07 +0000</pubDate>
		<dc:creator>Wez Pyke</dc:creator>
				<category><![CDATA[Cocoa/Objective-C]]></category>
		<category><![CDATA[basic]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[objc]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.thetutorialblog.com/?p=36</guid>
		<description><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	Related posts:Creating a basic iPad application Because of the recent announcement of the iPad 2 more... Related posts brought to you by Yet Another Related Posts Plugin.


Related posts:<ol><li><a href='http://www.thetutorialblog.com/cocoa-objective-c/creating-a-basic-ipad-application/' rel='bookmark' title='Permanent Link: Creating a basic iPad application'>Creating a basic iPad application</a> <small>Because of the recent announcement of the iPad 2 more...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fcocoa-objective-c%2Fbasic-iphone-button%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fcocoa-objective-c%2Fbasic-iphone-button%2F&amp;source=wezpyke&amp;style=normal&amp;service=bit.ly" height="61" width="50" title="Basic iPhone Button" alt=" Basic iPhone Button" /><br />
			</a>
		</div>
<p><object width="480" height="392" data="http://flash.revver.com/player/1.0/player.swf?mediaId=1266381&#038;affiliateId=42154" type="application/x-shockwave-flash" id="revvervideoa17743d6aebf486ece24053f35e1aa23"><param name="Movie" value="http://flash.revver.com/player/1.0/player.swf?mediaId=1266381&#038;affiliateId=42154"></param><param name="FlashVars" value="allowFullScreen=true&#038;backColor=#000000&#038;frontColor=#ffffff&#038;gradColor=#000000"></param><param name="AllowFullScreen" value="true"></param><param name="AllowScriptAccess" value="always"></param><embed type="application/x-shockwave-flash" src="http://flash.revver.com/player/1.0/player.swf?mediaId=1266381&#038;affiliateId=42154" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always" flashvars="allowFullScreen=true&#038;backColor=#000000&#038;frontColor=#ffffff&#038;gradColor=#000000" allowfullscreen="true" width="480" height="392"></embed></object></p>


<p>Related posts:<ol><li><a href='http://www.thetutorialblog.com/cocoa-objective-c/creating-a-basic-ipad-application/' rel='bookmark' title='Permanent Link: Creating a basic iPad application'>Creating a basic iPad application</a> <small>Because of the recent announcement of the iPad 2 more...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thetutorialblog.com/cocoa-objective-c/basic-iphone-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alert Sheet in Cocoa/Objective-C</title>
		<link>http://www.thetutorialblog.com/cocoa-objective-c/alert-sheet-in-cocoaobjective-c/</link>
		<comments>http://www.thetutorialblog.com/cocoa-objective-c/alert-sheet-in-cocoaobjective-c/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 18:09:17 +0000</pubDate>
		<dc:creator>Wez Pyke</dc:creator>
				<category><![CDATA[Cocoa/Objective-C]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[objc]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[sheet]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.katocan.com/?p=7</guid>
		<description><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	A tutorial showing how to create an alert sheet in objective-c/cocoa/xcode. Related posts:Creating a basic iPad application Because of the recent announcement of the iPad 2 more... Related posts brought to you by Yet Another Related Posts Plugin.


Related posts:<ol><li><a href='http://www.thetutorialblog.com/cocoa-objective-c/creating-a-basic-ipad-application/' rel='bookmark' title='Permanent Link: Creating a basic iPad application'>Creating a basic iPad application</a> <small>Because of the recent announcement of the iPad 2 more...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fcocoa-objective-c%2Falert-sheet-in-cocoaobjective-c%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fcocoa-objective-c%2Falert-sheet-in-cocoaobjective-c%2F&amp;source=wezpyke&amp;style=normal&amp;service=bit.ly" height="61" width="50" title="Alert Sheet in Cocoa/Objective C" alt=" Alert Sheet in Cocoa/Objective C" /><br />
			</a>
		</div>
<p>A tutorial showing how to create an alert sheet in objective-c/cocoa/xcode.</p>
<p><script src="http://flash.revver.com/player/1.0/player.js?mediaId:735460;affiliateId:42154;backColor:#000000;frontColor:#ffffff;gradColor:#000000;width:480;height:392;" type="text/javascript"></script></p>


<p>Related posts:<ol><li><a href='http://www.thetutorialblog.com/cocoa-objective-c/creating-a-basic-ipad-application/' rel='bookmark' title='Permanent Link: Creating a basic iPad application'>Creating a basic iPad application</a> <small>Because of the recent announcement of the iPad 2 more...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thetutorialblog.com/cocoa-objective-c/alert-sheet-in-cocoaobjective-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

