<?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>iOSConsultancy</title>
	<atom:link href="http://iosconsultancy.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://iosconsultancy.co.uk</link>
	<description>iOS Tutorials and Consultancy - and you can be an author</description>
	<lastBuildDate>Thu, 12 Apr 2012 18:10:20 +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>New Website: Now Features Facebook Integration</title>
		<link>http://iosconsultancy.co.uk/2012/04/12/new-website-now-features-facebook-integration/</link>
		<comments>http://iosconsultancy.co.uk/2012/04/12/new-website-now-features-facebook-integration/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 18:10:20 +0000</pubDate>
		<dc:creator>Matthew Casey</dc:creator>
				<category><![CDATA[Site News]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[feature]]></category>
		<category><![CDATA[new]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[site]]></category>

		<guid isPermaLink="false">http://iosconsultancy.co.uk/?p=726</guid>
		<description><![CDATA[<p>One of the other great features of the new website is Facebook Integration. This means when we post on the main iOSConsultancy blog, it will also be posted to facebook. And when you comment on facebook it will automatically appear on this site! Check it out!</p>
 ]]></description>
			<content:encoded><![CDATA[<p>One of the other great features of the new website is Facebook Integration. This means when we post on the main iOSConsultancy blog, it will also be posted to facebook. And when you comment on facebook it will automatically appear on this site! Check it out!</p>
]]></content:encoded>
			<wfw:commentRss>http://iosconsultancy.co.uk/2012/04/12/new-website-now-features-facebook-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome to the new iOSConsultancy.co.uk &#8211; Create a FREE blog today!</title>
		<link>http://iosconsultancy.co.uk/2012/04/12/welcome-to-the-new-iosconsultancy-co-uk-create-a-free-blog-today/</link>
		<comments>http://iosconsultancy.co.uk/2012/04/12/welcome-to-the-new-iosconsultancy-co-uk-create-a-free-blog-today/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 16:00:36 +0000</pubDate>
		<dc:creator>Matthew Casey</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Site News]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[create]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[new]]></category>
		<category><![CDATA[site]]></category>

		<guid isPermaLink="false">http://iosconsultancy.co.uk/?p=710</guid>
		<description><![CDATA[<p>Welcome to the new look of iOSConsultancy.co.uk. The new look is only just the start! We have built in hundreds of new features that you will just love!! Top of the list is the ability for you to create your own website for free for iOS tutorials. Got some tips or experience you would like to [...]</p>
 ]]></description>
			<content:encoded><![CDATA[<p>Welcome to the new look of iOSConsultancy.co.uk. The new look is only just the start! We have built in hundreds of new features that you will just love!! Top of the list is the ability for you to create your own website <strong>for free</strong> for iOS tutorials. Got some tips or experience you would like to share with the world, iOSConsultancy.co.uk is the place to do that!<span id="more-710"></span></p>
<p>Creating a blog is a three step process:</p>
<p><div class='et-box et-shadow'>
					<div class='et-box-content'><div class='three_fourth'>
					<a href="http://iosconsultancy.co.uk/wp-content/uploads/2012/04/Numbers-1-Filled-32.png"><img class="alignleft size-full wp-image-666" title="Numbers-1-Filled-32" src="http://iosconsultancy.co.uk/wp-content/uploads/2012/04/Numbers-1-Filled-32.png" alt="" width="32" height="32" /></a><strong>Register With Us</strong></p>
<p><strong></strong>To be able to create a blog you will first of all need a profile. Create one by clicking that register link! Still free!
				</div>
<div class='one_fourth last'>
					<a href='/register' class='small-button smallred' target="_blank"><span>Register</span></a>
				</div><div class='clear'></div></p></div></div><br />
<div class='et-box et-shadow'>
					<div class='et-box-content'><div class='three_fourth'>
					<a href="http://iosconsultancy.co.uk/wp-content/uploads/2012/04/Numbers-2-Filled-32.png"><img class="alignleft size-full wp-image-667" title="Numbers-2-Filled-32" src="http://iosconsultancy.co.uk/wp-content/uploads/2012/04/Numbers-2-Filled-32.png" alt="" width="32" height="32" /></a><strong>Create a Site</strong></p>
<p>You may have done this when you registered, but if not head over to the create a site page to create one! Your website will become live as soon as you click go.
				</div><div class='one_fourth last'>
					<a href='/blogs/create' class='small-button smallred' target="_blank"><span>Create</span></a>
				</div><div class='clear'></div></div></div><br />
<div class='et-box et-shadow'>
					<div class='et-box-content'><a href="http://iosconsultancy.co.uk/wp-content/uploads/2012/04/Numbers-3-Filled-32.png"><img class="alignleft size-full wp-image-668" title="Numbers-3-Filled-32" src="http://iosconsultancy.co.uk/wp-content/uploads/2012/04/Numbers-3-Filled-32.png" alt="" width="32" height="32" /></a><strong>Write some content!</strong></p>
<p><strong></strong>The final part is to actually write some content! But this doesn&#8217;t need done right away, the idea of a site on iOSConsultancy is that you add to it over time!</p></div></div></p>
]]></content:encoded>
			<wfw:commentRss>http://iosconsultancy.co.uk/2012/04/12/welcome-to-the-new-iosconsultancy-co-uk-create-a-free-blog-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ICEase &#8211; A new Open Source iOS Framework</title>
		<link>http://iosconsultancy.co.uk/2012/04/03/icease-a-new-open-source-ios-framework/</link>
		<comments>http://iosconsultancy.co.uk/2012/04/03/icease-a-new-open-source-ios-framework/#comments</comments>
		<pubDate>Tue, 03 Apr 2012 14:57:23 +0000</pubDate>
		<dc:creator>Matthew Casey</dc:creator>
				<category><![CDATA[Beginner Tutorials]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[ICEase]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[NSLog]]></category>
		<category><![CDATA[output]]></category>

		<guid isPermaLink="false">http://www.iosconsultancy.co.uk/?p=566</guid>
		<description><![CDATA[<p>Often when developing there are a few little snippets of code that would be really handy if they were included in the iOS SDK. We have just released version 1.0 of ICEase &#8211; our new lightweight framework. This initial release currently only has one module: Logging. Built In Logging Functionality With the iOS SDK logging [...]</p>
 ]]></description>
			<content:encoded><![CDATA[<p>Often when developing there are a few little snippets of code that would be really handy if they were included in the iOS SDK. We have just released version 1.0 of ICEase &#8211; our new lightweight framework. This initial release currently only has one module: <strong>Logging.</strong></p>
<h2>Built In Logging Functionality</h2>
<p>With the iOS SDK logging is usually done as follows using the <strong>NSLog</strong> function.</p>
<p></p><pre class="crayon-plain-tag">NSLog(@&quot;My name is %@ %@&quot;, firstName, lastName);</pre><p></p>
<p>This is great except:</p>
<ul>
<li>There is no way to set logging levels. For example, &#8220;only show error messages but not debug info&#8221;</li>
<li>It can be convoluted to log something very simple, often just a single string</li>
</ul>
<h2>Introducing ICEase[Logging]</h2>
<p>ICEase has two very different ways to interact with it, depending on your preference. If you like Objective-C style method calls, you can use syntax such as:</p>
<p></p><pre class="crayon-plain-tag">[[ICEaseLogCentre logCentre] logAtLevel:ICEaseLogLevelDebug string:@&quot;My Log Output&quot;];</pre><p></p>
<p>A far more compact way to interact with ICEase[Logging] is to use the C-style syntax such as:</p>
<p></p><pre class="crayon-plain-tag">ICEaseDebug(@&quot;My Log Outtput&quot;);</pre><p></p>
<h2>Debug Levels</h2>
<p>Built into the initial release of ICEase[Logging] are four logging levels. These are described below:</p>
<ul>
<li><strong>ICEaseLogLevelUndefined</strong> &#8211; This will output no logging at all &#8211; This is the default option</li>
<li><strong>ICEaseLogLevelError</strong> &#8211; This will output only logs made with the ICEaseError() or ICEaseErrorFormat() functions</li>
<li><strong>ICEaseLogLevelWarning</strong> &#8211; This will output only logs made with any of the following functions: ICEaseError(), ICEaseErrorFormat(), ICEaseWarn(), ICEaseWarnFormat()</li>
<li><strong>ICEaseLogLevelDebug</strong> &#8211; This will output only logs made with any of the following functions: ICEaseError(), ICEaseErrorFormat(), ICEaseWarn(), ICEaseWarnFormat(), ICEaseDebug(), ICEaseDebugFormat()</li>
</ul>
<p>To set the logging level for your application (a good place to do this is applicationDidFinishLaunching), you can use either of the following options:</p><pre class="crayon-plain-tag">ICEaseSetLogLevel(ICEaseLogLevelWarning);</pre><p>-or-</p><pre class="crayon-plain-tag">[ICEaseLogCentre setLogLevel:ICEaseLogLevelWarning];</pre><p></p>
<h2>Logging an Object</h2>
<p>Often you want to just log an individual object, perhaps a string. When programming one of the things I do most often for debugging purposes is:</p><pre class="crayon-plain-tag">NSLog(@&quot;%@&quot;, myString);</pre><p>With ICEase[Logging] this is far easier. With any subclass of NSObject you can call any of the following methods: <em>logDebug, logWarn, logError</em>. For example:</p><pre class="crayon-plain-tag">[myString logDebug];</pre><p>The above example will log the description of the myString object only when logging mode is set to debug.</p>
<h2>Where Can I Get This?</h2>
<p>This project is hosted on GitHub. If you would like to use it you can download a ZIP file from the GitHub page or you can clone it to your computer.<br />
If you have a fix or an improvement for ICEase please do send it in using the usual GitHub methods! This is a collaborative project.<br />
<a href="https://github.com/iosconsultancy/ICEase" target="_blank">Visit GitHub Page Now</a></p>
]]></content:encoded>
			<wfw:commentRss>http://iosconsultancy.co.uk/2012/04/03/icease-a-new-open-source-ios-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The new iPad</title>
		<link>http://iosconsultancy.co.uk/2012/03/08/the-new-ipad/</link>
		<comments>http://iosconsultancy.co.uk/2012/03/08/the-new-ipad/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 11:45:15 +0000</pubDate>
		<dc:creator>Matthew Casey</dc:creator>
				<category><![CDATA[Apple News]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[3]]></category>
		<category><![CDATA[a5x]]></category>
		<category><![CDATA[airplay]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[device]]></category>
		<category><![CDATA[hd]]></category>
		<category><![CDATA[high]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[new]]></category>
		<category><![CDATA[resolution]]></category>
		<category><![CDATA[retina]]></category>
		<category><![CDATA[tv]]></category>

		<guid isPermaLink="false">http://www.iosconsultancy.co.uk/?p=554</guid>
		<description><![CDATA[<p>Yesterday saw the introduction of The new iPad. This was one of the many announcements apple made yesterday. In this short article we will outline our thoughts on the new iPad from both a users point of view and a developers point of view. The major new feature in this iPad is of course the [...]</p>
 ]]></description>
			<content:encoded><![CDATA[<p>Yesterday saw the introduction of <strong>The new iPad. </strong>This was one of the many announcements apple made yesterday. In this short article we will outline our thoughts on the new iPad from both a users point of view and a developers point of view.</p>
<div id="attachment_555" class="wp-caption aligncenter" style="width: 310px"><a href="http://image.iosconsultancy.co.uk/2012/03/iPad_HandHero_120305_piph.jpg"><img class="size-medium wp-image-555" src="http://image.iosconsultancy.co.uk/2012/03/iPad_HandHero_120305_piph-300x239.jpg" alt="" width="300" height="239" /></a><p class="wp-caption-text">The Retina Display</p></div>
<p>The major new feature in this iPad is of course the retina display. The display is an ultra high resolution screen. The screen has 3.1 Million pixels on a 9.7&#8243; screen. This translates to a resolution of 2048&#215;1536 or in common terms amazingly clear! The pixels are so small, Apple claim they are indistinguishable to the human eye. There are more pixels on this display (9.7&#8243;) than a 50&#8243; full HDTV for example. For a user this means the user interfaces will be slicker and more functional with the added screen real estate. But what does this mean for developers? Well to boot Apple will upgrade all existing applications to the higher res graphics for all system elements such as UIToolbar etc. All fonts will also be automatically updated. The techniques employed when the iPhone 4 surfaced will surely be employed again here. For example loading an image as follows:</p><pre class="crayon-plain-tag">[UIImage imageNamed:@&quot;MyImage&quot;]</pre><p></p>
<p>will load the image named MyImage.png from your application. If you are on an iPad 3 or iPhone 4 / 4S it will search instead for MyImage@2x.png if it exists. If not it will fall back to MyImage.png.</p>
<p>But if developers spend a little time in there applications to make use of the quadrupled number of pixels the iOS App Store will become that huge step better! Imagine the possibilities for an application that can power more pixels than a HD TV.</p>
<p>Alongside the new screen comes a new Apple-branded system-on-a-chip. The first iPad had the A4 processor, the second the A5 and the third the A5X. From initial reactions the device seems incredibly responsive. Apple claims 2x performance on the iPad 2 and 4x graphic performance. It is still dual core though, disappointing expectations of a quad core processor. The graphics chip is however now quad core. This is great for users for obvious reasons but for developers this means we can now build even more complex and powerful applications and the device won&#8217;t even break a sweat.</p>
<p>The next publicly pushed feature of <strong>The new iPad</strong> is the iSight camera. The back camera on the iPad has been upgraded to the new sensors and mechanics found in the iPhone 4S. The device now has the capability to shoot 5MP photos as well as record full 1080p video. With the release of iOS 5.1 the camera app has been rewritten on the iPad to make use of this new camera. Of course we have autofocus, face detection, geotagging, image stabilisation on video recording. And obviously the VGA camera for FaceTime calls is still present on the front of the device.</p>
<p>The battery has been much improved in this device. To the untrained eye it doesn&#8217;t look at all different from the iPad 2 but when you consider the much improved performance and the machine now driving 4x as many dots, managing to squeeze the same 10 hours out of the device is an achievement! The battery, as expected is bigger than in the iPad 2 adding a little weight and thickness to the device.</p>
<p>The final feature we will briefly mention here is of course the 4G LTE networking. The new iPad is one of the first devices (phones included) to support this new network standard. Its so new infact, that the coverage so far isn&#8217;t great. Of course the device still supports previous generation networks such as 3G and edge but we are future compatible for 4G LTE. This new network standard boasts download speeds of 70+Mb/s. This could be a year or so away for us Brits.</p>
<p>Look out for the full review of The new iPad at the end of next week when the device ships. We have our own iPad Wifi 16GB on its way to us as we speak along with a few accessories. Until then, keep drooling over this piece of tech from apple folks!</p>
<p>[showhide type="pressrelease"]SAN FRANCISCO―March 7, 2012―Apple today introduced the new iPad, the third generation of its category defining mobile device, featuring a stunning new Retina display, Apple’s new A5X chip with quad-core graphics and a 5 megapixel iSight camera with advanced optics for capturing amazing photos and 1080p HD video. iPad with Wi-Fi + 4G connects to fast networks worldwide, including AT&amp;T’s and Verizon’s 4G LTE networks, and still delivers the same all-day 10 hour battery life* while remaining amazingly thin and light. Beginning today, iPad 2 will be offered at an even more affordable price starting at just £329 inc VAT.</p>
<p>“The new iPad redefines the category Apple created less than two years ago, delivering the most amazing experience people have ever had with technology,” said Philip Schiller, Apple’s senior vice president of Worldwide Marketing. “The new iPad now has the highest resolution display ever seen on a mobile device with 3.1 million pixels, delivering razor sharp text and unbelievable detail in photos and videos.”</p>
<p>The new iPad’s Retina display delivers four times the number of pixels of iPad 2, so dense that the human eye is unable to distinguish individual pixels when held at a normal distance, making web pages, text, images and video look incredibly sharp and realistic. The 3.1 million pixels in the Retina display are more than one million more pixels than an HD TV, and with 44 percent increased colour saturation the new iPad displays colours that are unbelievably richer, deeper and more vivid. Movies are now capable of playing at full 1080p HD-resolution, delivering an incomparable viewing experience on a mobile device.</p>
<p>The powerful new A5X chip with quad-core graphics was specifically designed by Apple to deliver a fast, responsive user experience while supporting the incredible Retina display. With double the graphics performance of the A5 chip, the A5X provides a superb balance between performance and power efficiency so users can enjoy all the benefits of the stunning new display while experiencing a smooth Multi-Touch interface, immersive gameplay, incredible visual depth and all-day battery life that iPad is known for delivering.</p>
<p>The 5 megapixel iSight camera features advanced optics for taking stunning pictures and recording full HD video. Backside illumination allows you to take great photos in low-light conditions and a new video image stabilisation feature removes the bumps and shakes typically seen when filming with a hand-held device. Images can be enjoyed on the large Retina display, then edited, enhanced and easily shared with friends and family using the built-in Photos app on iPad.</p>
<p>iPad Wi-Fi + 4G with built-in next generation 4G LTE has the most comprehensive support for fast networks worldwide including HSPA+ and DC-HSDPA, and now both CDMA and GSM iPad users have the ability to easily roam internationally. The world-ready iPad delivers blazing download and upload speeds so web pages load incredibly quickly and email with large attachments can be sent and received easily. Personal Hotspot can be used to share the fast network connection on your iPad with up to 5 other devices using Wi-Fi, Bluetooth or USB**.</p>
<p>With iOS 5.1, the latest update to the world’s most advanced mobile operating system, the new iPad has a number of new features and enhancements including: a redesigned Camera app with video stabilisation technology; the ability to delete photos from Photo Stream; support for dictation in English, French, German and Japanese; and Personal Hotspot. iOS 5.1 also works seamlessly with iCloud, a breakthrough set of free cloud services including iTunes in the Cloud, Photo Stream and Documents in the Cloud, that works seamlessly with your iPhone, iPad, iPod touch, Mac or PC to automatically and wirelessly store your content and push it to your devices. When content changes on one of your devices, your other devices are updated automatically.</p>
<p>The new iPad also supports dictation, another amazing way to get things done just using your voice. Instead of typing, tap the microphone icon on the keyboard, then say what you want to say and the new iPad listens. Tap done, and iPad converts your words into text. You can use dictation to write messages, take notes, search the web and more. Dictation also works with third-party apps, so you can update your Facebook status, tweet, or write Instagram captions.</p>
<p>Apple also introduced the iPhoto app, along with major updates to iMovie and GarageBand, completing its suite of iLife apps for iOS. iLife and the iWork apps, Pages, Keynote and Numbers, have all been updated to take advantage of the new iPad Retina display. iPhoto includes breakthrough Multi-Touch features so you can use simple gestures to sort through hundreds of photos and find your best shots, enhance and retouch your images using fingertip brushes and share stunning photo journals with iCloud. iMovie now gives you the ability to create amazing Hollywood-style trailers as you record HD video, and GarageBand introduces Jam Session, an innovative and fun new feature that allows a group of friends to wirelessly connect to play instruments and record music together live on their iOS devices.</p>
<p>iPad runs almost all of the over 585,000 apps available on the App Store, including more than 200,000 native iPad apps, from a wide range of categories, including books, games, business, news, sports, health, reference and travel. The iTunes Store puts the world’s most popular online music, TV and movie store at your fingertips with a catalog of over 20 million songs, over 90,000 TV episodes and over 15,000 movies. The new iBooks 2 app for iPad lets users experience an entirely new kind of ebook that’s dynamic, engaging and truly interactive. iBooks created with Apple’s new iBooks Author offer gorgeous, fullscreen ebooks with interactive animations, diagrams, photos, videos, unrivaled navigation and much more.</p>
<p>Pricing &amp; Availability<br />
The new iPad Wi-Fi models will be available in black or white on Friday, March 16 for a suggested retail price of £399 inc VAT (£332.50 ex VAT) for the 16GB model, £479 inc VAT (£399.17 ex VAT) for the 32GB model and £559 inc VAT (£465.83 ex VAT) for the 64GB model. iPad Wi-Fi + 4G will be available for a suggested retail price of £499 inc VAT (£415.83 ex VAT) for the 16GB model, £579 inc VAT (£482.50 ex VAT) for the 32GB model and £659 inc VAT (£549.17 ex VAT) for the 64GB model. iPad will be sold in the UK through the Apple Store (www.apple.com/uk), Apple’s retail stores, and select Apple Authorised Resellers. iPad will also be available in Australia, Canada, France, Germany, Hong Kong, Japan, Puerto Rico, Singapore, Switzerland and the US Virgin Islands on Friday, March 16. Customers can begin pre-ordering their new iPad today, and the incredible iPad 2 is now offered at a more affordable price of £329 inc VAT (£274.17 ex VAT) for the 16GB Wi-Fi model and just £429 inc VAT (£357.50 ex VAT) for the 16GB Wi-Fi + 3G model.</p>
<p>iOS 5.1 and iTunes 10.6 are available today as free software updates. iPhoto, iMovie 1.3 and GarageBand 1.2 are available today for £2.99 each from the App Store (www.itunes.com/appstore). Keynote 1.6, Pages 1.6 and Numbers 1.6 are available today for £6.99 each from the App Store. Updates are available for free to existing customers. By the end of March iPad will be available in Austria, Belgium, Bulgaria, Czech Republic, Denmark, Finland, Greece, Hungary, Iceland, Ireland, Italy, Liechtenstein, Luxembourg, Macau, Mexico, The Netherlands, New Zealand, Norway, Poland, Portugal, Romania, Slovakia, Slovenia, Spain and Sweden.</p>
<p>*Battery life depends on device settings, usage and other factors. Actual results vary.</p>
<p>**Personal Hotspot requires supporting data plan. Customers should check with their carrier for availability.</p>
<p>Apple designs Macs, the best personal computers in the world, along with OS X, iLife, iWork and professional software. Apple leads the digital music revolution with its iPods and iTunes online store. Apple has reinvented the mobile phone with its revolutionary iPhone and App Store, and is defining the future of mobile media and computing devices with iPad.[/showhide]</p>
]]></content:encoded>
			<wfw:commentRss>http://iosconsultancy.co.uk/2012/03/08/the-new-ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Video Tutorial: Create a Tasks Application from the Ground Up – Part 3</title>
		<link>http://iosconsultancy.co.uk/2012/02/07/video-tutorial-create-a-tasks-application-from-the-ground-up-part-3/</link>
		<comments>http://iosconsultancy.co.uk/2012/02/07/video-tutorial-create-a-tasks-application-from-the-ground-up-part-3/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 11:42:01 +0000</pubDate>
		<dc:creator>Matthew Casey</dc:creator>
				<category><![CDATA[Intermediate Tutorials]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[4.2]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[iOS5]]></category>
		<category><![CDATA[storyboard]]></category>
		<category><![CDATA[tasks]]></category>
		<category><![CDATA[tasks4part]]></category>
		<category><![CDATA[todo]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[xcode]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://www.iosconsultancy.co.uk/?p=463</guid>
		<description><![CDATA[<p>In this tutorial we will be creating an application that manages tasks. The application will show you the MVC techniques for programming, how to make best use of Objective C features, as well as how to utilise storyboards to there full potential. This is a four part tutorial, and in this part we are further [...]</p>
 ]]></description>
			<content:encoded><![CDATA[<p>In this tutorial we will be creating an application that manages tasks. The application will show you the MVC techniques for programming, how to make best use of Objective C features, as well as how to utilise storyboards to there full potential.</p>
<p>This is a four part tutorial, and in this part we are further implementing our AllTasks screen as well as adding the Add Task screen and fixing some bugs. Click that good old more link to watch this part, or<a href="http://www.iosconsultancy.co.uk/tag/tasks4part"> click here to see all parts of this tutorial</a>.</p>
<p><span id="more-463"></span></p>
<p><iframe width="500" height="281" src="http://www.youtube.com/embed/J1SJz2mlMJs?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<h3>Code Listing</h3>
<p><strong>ICTasksBrain.m</strong></p><pre class="crayon-plain-tag">//
// ICTasksBrain.m
// Tasks
//
// Created by Matthew Casey on 06/02/2012.
// Copyright (c) 2012 iOSConsultancy.co.uk. All rights reserved.
//

#import &quot;ICTasksBrain.h&quot;
static ICTasksBrain *mainBrainObject = nil;

@interface ICTasksBrain()
@property (nonatomic, strong) NSMutableArray *tasks;
@property (nonatomic, strong) NSMutableArray *activity;
-(void)addActivityItem:(NSString *)aItem;
@end

@implementation ICTasksBrain
@synthesize tasks = _tasks;
-(NSMutableArray *)tasks {
if (!_tasks) _tasks = [[NSMutableArray alloc] init];
return _tasks;
}
@synthesize activity = _activity;
-(NSMutableArray *)activity {
if (!_activity) _activity = [[NSMutableArray alloc] init];
return _activity;
}

-(void)addTask:(ICTask *)aTask {
[self.tasks addObject:aTask];
[self addActivityItem:[NSString stringWithFormat:@&quot;Added Task &quot;%@&quot;&quot;, aTask.taskTitle]];
}

-(void)completeTask:(ICTask *)aTask {
[self.tasks removeObject:aTask];
[self addActivityItem:[NSString stringWithFormat:@&quot;Completed Task &quot;%@&quot;&quot;, aTask.taskTitle]];
}

-(void)addActivityItem:(NSString *)aItem {
[self.activity insertObject:aItem atIndex:0];
}

-(NSArray *)allActivity {
return [self.activity copy];
}

-(NSArray *)allTasksWithPriority:(ICTaskPriority)aPriority {
NSPredicate *filter = [NSPredicate predicateWithFormat:@&quot;taskPriority == %i&quot;, aPriority];
return [self.tasks filteredArrayUsingPredicate:filter];
}

+(ICTasksBrain *)mainBrain {
@synchronized(self) {
if (!mainBrainObject) {
mainBrainObject = [[ICTasksBrain alloc] init];
}
}
return mainBrainObject;
}

@end</pre><p><strong>ICTasksTableViewController.m</strong></p><pre class="crayon-plain-tag">//
// ICTasksTableViewController.m
// Tasks
//
// Created by Matthew Casey on 06/02/2012.
// Copyright (c) 2012 iOSConsultancy.co.uk. All rights reserved.
//

#import &quot;ICTasksTableViewController.h&quot;
#import &quot;ICTasksBrain.h&quot;
@interface ICTasksTableViewController()
@property (nonatomic, strong) NSArray *lowTasks;
@property (nonatomic, strong) NSArray *mediumTasks;
@property (nonatomic, strong) NSArray *highTasks;
@end

@implementation ICTasksTableViewController
@synthesize lowTasks = _lowTasks;
-(NSArray *)lowTasks {
if (!_lowTasks) _lowTasks = [[ICTasksBrain mainBrain] allTasksWithPriority:ICTaskPriorityLow];
return _lowTasks;
}
@synthesize mediumTasks = _mediumTasks;
-(NSArray *)mediumTasks {
if (!_mediumTasks) _mediumTasks = [[ICTasksBrain mainBrain] allTasksWithPriority:ICTaskPriorityMedium];
return _mediumTasks;
}
@synthesize highTasks = _highTasks;
-(NSArray *)highTasks {
if (!_highTasks) _highTasks = [[ICTasksBrain mainBrain] allTasksWithPriority:ICTaskPriorityHigh];
return _highTasks;
}
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}

- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];

// Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
[super viewDidLoad];

// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;

// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}

- (void)viewWillAppear:(BOOL)animated
{
self.lowTasks = nil;
self.mediumTasks = nil;
self.highTasks = nil;
[self.tableView reloadData];
[super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 3;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
if (section == 0) {
//low priority array
return self.lowTasks.count;
} else if (section == 1) {
//medium priority array
return self.mediumTasks.count;
} else if (section == 2) {
//high priorirty array
return self.highTasks.count;
} else {
return 0; //this should never happen
}
}

-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
if (section == 0) {
return @&quot;Low Priority&quot;;
} else if (section == 1) {
return @&quot;Medium Priority&quot;;
} else if (section == 2) {
return @&quot;High Priority&quot;;
} else {
return nil; //this shoudl NEVER happen
}
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
ICTask *ourTask = nil;
UIColor *color = nil;
if (indexPath.section == 0) {
ourTask = [self.lowTasks objectAtIndex:indexPath.row];
color = [UIColor greenColor];
} else if (indexPath.section == 1) {
ourTask = [self.mediumTasks objectAtIndex:indexPath.row];
color = [UIColor orangeColor];
} else if (indexPath.section == 2) {
ourTask = [self.highTasks objectAtIndex:indexPath.row];
color = [UIColor redColor];
}
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@&quot;TaskCell&quot;];
cell.textLabel.text = ourTask.taskTitle;
cell.detailTextLabel.text = ourTask.taskDescription;
UIView *priorityView = [[UIView alloc] initWithFrame:CGRectMake(cell.bounds.size.width - 20, 0, 20, cell.bounds.size.height)];
priorityView.backgroundColor = color;
[cell addSubview:priorityView];
return cell;
}

/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the specified item to be editable.
return YES;
}
*/

-(NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
return @&quot;Complete&quot;;
}

// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
ICTask *taskToComplete = nil;
if (indexPath.section == 0) {
taskToComplete = [self.lowTasks objectAtIndex:indexPath.row];
self.lowTasks = nil;
} else if (indexPath.section == 1) {
taskToComplete = [self.mediumTasks objectAtIndex:indexPath.row];
self.mediumTasks = nil;
} else if (indexPath.section == 2) {
taskToComplete = [self.highTasks objectAtIndex:indexPath.row];
self.highTasks = nil;
}
[[ICTasksBrain mainBrain] completeTask:taskToComplete];
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the item to be re-orderable.
return YES;
}
*/

#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

}

@end</pre><p><strong>ICActivityTableViewController.m</strong></p><pre class="crayon-plain-tag">//
// ICActivityTableViewController.m
// Tasks
//
// Created by Matthew Casey on 06/02/2012.
// Copyright (c) 2012 iOSConsultancy.co.uk. All rights reserved.
//

#import &quot;ICActivityTableViewController.h&quot;
#import &quot;ICTasksBrain.h&quot;
@interface ICActivityTableViewController()
@property (nonatomic, strong) NSArray *activity;
@end
@implementation ICActivityTableViewController
@synthesize activity = _activity;
-(NSArray *)activity {
if (!_activity) _activity = [[ICTasksBrain mainBrain] allActivity];
return _activity;
}
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}

- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];

// Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
[super viewDidLoad];

// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;

// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}

- (void)viewWillAppear:(BOOL)animated
{
self.activity = nil;
[self.tableView reloadData];
[super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return self.activity.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@&quot;ActivityCell&quot;];
cell.textLabel.text = [self.activity objectAtIndex:indexPath.row];
return cell;
}

/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the specified item to be editable.
return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the item to be re-orderable.
return YES;
}
*/

#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

}

@end</pre><p><strong>ICAddTaskTableViewController.h</strong></p><pre class="crayon-plain-tag">//
// ICAddTaskTableViewController.h
// Tasks
//
// Created by Matthew Casey on 07/02/2012.
// Copyright (c) 2012 iOSConsultancy.co.uk. All rights reserved.
//

#import
#import &quot;ICTasksBrain.h&quot;
@interface ICAddTaskTableViewController : UITableViewController
@property (nonatomic) ICTaskPriority taskPriority;
@property (weak, nonatomic) IBOutlet UITextField *txtTitle;
@property (weak, nonatomic) IBOutlet UITextView *txtDescription;
- (IBAction)doneTapped:(id)sender;
- (IBAction)cancelTapped:(id)sender;
@end</pre><p><strong>ICAddTaskTableViewController.m</strong></p><pre class="crayon-plain-tag">//
// ICAddTaskTableViewController.m
// Tasks
//
// Created by Matthew Casey on 07/02/2012.
// Copyright (c) 2012 iOSConsultancy.co.uk. All rights reserved.
//

#import &quot;ICAddTaskTableViewController.h&quot;

@implementation ICAddTaskTableViewController
@synthesize taskPriority = _taskPriority;
@synthesize txtTitle = _txtTitle;
@synthesize txtDescription = _txtDescription;
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}

- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];

// Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
[super viewDidLoad];

// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;

// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)viewDidUnload
{
[self setTxtTitle:nil];
[self setTxtDescription:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}

- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

#pragma mark - Table view delegate
-(NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
return nil;
} else {
return indexPath;
}
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
self.taskPriority = indexPath.row;
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.accessoryType = UITableViewCellAccessoryCheckmark;
int i;
for (i=0; i NSIndexPath *tempIP = [NSIndexPath indexPathForRow:i inSection:indexPath.section];
UITableViewCell *tempCell = [tableView cellForRowAtIndexPath:tempIP];
if (![tempCell isEqual:cell]) {
tempCell.accessoryType = UITableViewCellAccessoryNone;
}
}
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}

- (IBAction)doneTapped:(id)sender {
ICTask *newTask = [[ICTask alloc] init];
newTask.taskTitle = self.txtTitle.text;
newTask.taskDescription = self.txtDescription.text;
newTask.taskPriority = self.taskPriority;//wher does this come from?
[[ICTasksBrain mainBrain] addTask:newTask];
[self.parentViewController dismissModalViewControllerAnimated:YES];
}

- (IBAction)cancelTapped:(id)sender {
[self.parentViewController dismissModalViewControllerAnimated:YES];
}
@end</pre><p> </p>
]]></content:encoded>
			<wfw:commentRss>http://iosconsultancy.co.uk/2012/02/07/video-tutorial-create-a-tasks-application-from-the-ground-up-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Video Tutorial: Create a Tasks Application from the Ground Up &#8211; Part 2</title>
		<link>http://iosconsultancy.co.uk/2012/02/06/video-tutorial-create-a-tasks-application-from-the-ground-up-part-2/</link>
		<comments>http://iosconsultancy.co.uk/2012/02/06/video-tutorial-create-a-tasks-application-from-the-ground-up-part-2/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 17:25:06 +0000</pubDate>
		<dc:creator>Matthew Casey</dc:creator>
				<category><![CDATA[Intermediate Tutorials]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[step]]></category>
		<category><![CDATA[stepbystep]]></category>
		<category><![CDATA[tasks4part]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[UITableViewCell]]></category>
		<category><![CDATA[UITableViewController]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.iosconsultancy.co.uk/?p=456</guid>
		<description><![CDATA[<p>This tutorial uses iOS 5 and Xcode 4.2 In this tutorial we will be creating an application that manages tasks. The application will show you the MVC techniques for programming, how to make best use of Objective C features, as well as how to utilise storyboards to there full potential. This is a four part [...]</p>
 ]]></description>
			<content:encoded><![CDATA[<p><em>This tutorial uses iOS 5 and Xcode 4.2</em></p>
<p>In this tutorial we will be creating an application that manages tasks. The application will show you the MVC techniques for programming, how to make best use of Objective C features, as well as how to utilise storyboards to there full potential.</p>
<p>This is a four part tutorial, and in this part we will be setting up the beginnings of our table views as well as our table view cells. Click the more link to watch this part or <a href="http://www.iosconsultancy.co.uk/tag/tasks4part">click here to see all the parts</a>.</p>
<p><span id="more-456"></span></p>
<p><iframe width="500" height="375" src="http://www.youtube.com/embed/04XbZiiupPA?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<h3>Code Listing</h3>
<p><strong>ICTasksTableViewController.m</strong></p>
<p></p><pre class="crayon-plain-tag">//
//  ICTasksTableViewController.m
//  Tasks
//
//  Created by Matthew Casey on 06/02/2012.
//  Copyright (c) 2012 iOSConsultancy.co.uk. All rights reserved.
//

#import &quot;ICTasksTableViewController.h&quot;
#import &quot;ICTasksBrain.h&quot;
@interface ICTasksTableViewController()
@property (nonatomic, strong) NSArray *lowTasks;
@property (nonatomic, strong) NSArray *mediumTasks;
@property (nonatomic, strong) NSArray *highTasks;
@end

@implementation ICTasksTableViewController
@synthesize lowTasks = _lowTasks;
-(NSArray *)lowTasks {
    if (!_lowTasks) _lowTasks = [[ICTasksBrain mainBrain] allTasksWithPriority:ICTaskPriorityLow];
    return _lowTasks;
}
@synthesize mediumTasks = _mediumTasks;
-(NSArray *)mediumTasks {
    if (!_mediumTasks) _mediumTasks = [[ICTasksBrain mainBrain] allTasksWithPriority:ICTaskPriorityMedium];
    return _mediumTasks;
}
@synthesize highTasks = _highTasks;
-(NSArray *)highTasks {
    if (!_highTasks) _highTasks = [[ICTasksBrain mainBrain] allTasksWithPriority:ICTaskPriorityHigh];
    return _highTasks;
}
- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];

    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
 
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated
{
    [super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    // Return the number of sections.
    return 3;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    if (section == 0) {
        //low priority array
        return self.lowTasks.count;
    } else if (section == 1) {
        //medium priority array
        return self.mediumTasks.count;
    } else if (section == 2) {
        //high priorirty array
        return self.highTasks.count;
    } else {
        return 0; //this should never happen
    }
}

-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
    if (section == 0) {
        return @&quot;Low Priority&quot;;
    } else if (section == 1) {
        return @&quot;Medium Priority&quot;;
    } else if (section == 2) {
        return @&quot;High Priority&quot;;
    } else {
        return nil; //this shoudl NEVER happen
    }
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    ICTask *ourTask = nil;
    UIColor *color = nil;
    if (indexPath.section == 0) {
        ourTask = [self.lowTasks objectAtIndex:indexPath.row];
        color = [UIColor greenColor];
    } else if (indexPath.section == 1) {
        ourTask = [self.mediumTasks objectAtIndex:indexPath.row];
        color = [UIColor orangeColor];
    } else if (indexPath.section == 2) {
        ourTask = [self.highTasks objectAtIndex:indexPath.row];
        color = [UIColor redColor];
    }
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@&quot;TaskCell&quot;];
    cell.textLabel.text = ourTask.taskTitle;
    cell.detailTextLabel.text = ourTask.taskDescription;
    UIView *priorityView = [[UIView alloc] initWithFrame:CGRectMake(cell.bounds.size.width - 20, 0, 20, cell.bounds.size.height)];
    priorityView.backgroundColor = color;
    [cell addSubview:priorityView];
    return cell;
}

/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
    }   
    else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
}

@end</pre><p><strong>ICActivityTableViewController.m</strong></p><pre class="crayon-plain-tag">//
//  ICActivityTableViewController.m
//  Tasks
//
//  Created by Matthew Casey on 06/02/2012.
//  Copyright (c) 2012 iOSConsultancy.co.uk. All rights reserved.
//

#import &quot;ICActivityTableViewController.h&quot;
#import &quot;ICTasksBrain.h&quot;
@interface ICActivityTableViewController()
@property (nonatomic, strong) NSArray *activity;
@end
@implementation ICActivityTableViewController
@synthesize activity = _activity;
-(NSArray *)activity {
    if (!_activity) _activity = [[ICTasksBrain mainBrain] allActivity];
    return _activity;
}
- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];

    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
 
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated
{
    [super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    return self.activity.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@&quot;ActivityCell&quot;];
    cell.textLabel.text = [self.activity objectAtIndex:indexPath.row];
    return cell;
}

/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
    }   
    else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
}

@end</pre><p>{filelink=4}</p>
]]></content:encoded>
			<wfw:commentRss>http://iosconsultancy.co.uk/2012/02/06/video-tutorial-create-a-tasks-application-from-the-ground-up-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Video Tutorial: Create a Tasks Application from the Ground Up &#8211; Part 1</title>
		<link>http://iosconsultancy.co.uk/2012/02/06/video-tutorial-create-a-tasks-application-from-the-ground-up-part-1/</link>
		<comments>http://iosconsultancy.co.uk/2012/02/06/video-tutorial-create-a-tasks-application-from-the-ground-up-part-1/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 12:24:27 +0000</pubDate>
		<dc:creator>Matthew Casey</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Intermediate Tutorials]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[tasks]]></category>
		<category><![CDATA[tasks4part]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.iosconsultancy.co.uk/?p=446</guid>
		<description><![CDATA[<p>This tutorial uses iOS 5 and Xcode 4.2 In this tutorial we will be creating an application that manages tasks. The application will show you the MVC techniques for programming, how to make best use of Objective C features, as well as how to utilise storyboards to there full potential. This is a four part [...]</p>
 ]]></description>
			<content:encoded><![CDATA[<p><em>This tutorial uses iOS 5 and Xcode 4.2</em></p>
<p>In this tutorial we will be creating an application that manages tasks. The application will show you the MVC techniques for programming, how to make best use of Objective C features, as well as how to utilise storyboards to there full potential.</p>
<p>This is a four part tutorial, in this part we will be looking at setting up the storyboard, and creating our &#8220;model&#8221; &#8211; our tasks brain. Hit the more link to watch the first part of this tutorial. <a href="http://www.iosconsultancy.co.uk/tag/tasks4part">All parts of this tutorial can be found here</a>.</p>
<p><span id="more-446"></span></p>
<p><iframe width="500" height="281" src="http://www.youtube.com/embed/kmQIglmsfo8?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<h3>Code Listings</h3>
<p><strong>ICTasksBrain.h</strong></p>
<p></p><pre class="crayon-plain-tag">//

//&nbsp; ICTasksBrain.h

//&nbsp; Tasks

//

//&nbsp; Created by Matthew Casey on 06/02/2012.

//&nbsp; Copyright (c) 2012 iOSConsultancy.co.uk. All rights reserved.

//

#import &amp;lt;Foundation/Foundation.h&amp;gt;

#import &quot;ICTask.h&quot;

@interface ICTasksBrain : NSObject

-(void)addTask:(ICTask *)aTask;

-(void)completeTask:(ICTask *)aTask;

-(NSArray *)allActivity;

-(NSArray *)allTasksWithPriority:(ICTaskPriority)aPriority;

+(ICTasksBrain *)mainBrain;

@end</pre><p></p>
<p><strong>ICTasksBrain.m</strong></p>
<p></p><pre class="crayon-plain-tag">//

//&nbsp; ICTasksBrain.m

//&nbsp; Tasks

//

//&nbsp; Created by Matthew Casey on 06/02/2012.

//&nbsp; Copyright (c) 2012 iOSConsultancy.co.uk. All rights reserved.

//

#import &quot;ICTasksBrain.h&quot;

static ICTasksBrain *mainBrainObject = nil;

@interface ICTasksBrain()

@property (nonatomic, strong) NSMutableArray *tasks;

@property (nonatomic, strong) NSMutableArray *activity;

-(void)addActivityItem:(NSString *)aItem;

@end

@implementation ICTasksBrain

@synthesize tasks = _tasks;

-(NSMutableArray *)tasks {

if (!_tasks) _tasks = [[NSMutableArray alloc] init];

return _tasks;

}

@synthesize activity = _activity;

-(NSMutableArray *)activity {

if (!_activity) _activity = [[NSMutableArray alloc] init];

return _activity;

}

-(void)addTask:(ICTask *)aTask {

[self.tasks addObject:aTask];

[self addActivityItem:[NSString stringWithFormat:@&quot;Added Task &quot;%@&quot;&quot;, aTask.taskTitle]];

}

-(void)completeTask:(ICTask *)aTask {

[self.tasks removeObject:aTask];

[self addActivityItem:[NSString stringWithFormat:@&quot;Completed Task &quot;%@&quot;&quot;, aTask.taskTitle]];

}

-(void)addActivityItem:(NSString *)aItem {

[self.activity addObject:aItem];

}

+(ICTasksBrain *)mainBrain {

@synchronized(self) {

if (mainBrainObject) {

mainBrainObject = [[ICTasksBrain alloc] init];

}

}

return mainBrainObject;

}

@end</pre><p></p>
<p><strong>ICTask.h</strong></p>
<p></p><pre class="crayon-plain-tag">//

//&nbsp; ICTask.h

//&nbsp; Tasks

//

//&nbsp; Created by Matthew Casey on 06/02/2012.

//&nbsp; Copyright (c) 2012 iOSConsultancy.co.uk. All rights reserved.

//

#import

typedef enum ICTaskPriority {

ICTaskPriorityLow = 0,

ICTaskPriorityMedium,

ICTaskPriorityHigh

} ICTaskPriority;

@interface ICTask : NSObject

@property (nonatomic, strong) NSString *taskTitle;

@property (nonatomic, strong) NSString *taskDescription;

@property (nonatomic) ICTaskPriority taskPriority;

@end</pre><p></p>
<p><strong>ICTask.m</strong></p>
<p></p><pre class="crayon-plain-tag">//

//&nbsp; ICTask.m

//&nbsp; Tasks

//

//&nbsp; Created by Matthew Casey on 06/02/2012.

//&nbsp; Copyright (c) 2012 iOSConsultancy.co.uk. All rights reserved.

//

#import &quot;ICTask.h&quot;

@implementation ICTask

@synthesize taskTitle = _taskTitle;

@synthesize taskDescription = _taskDescription;

@synthesize taskPriority = _taskPriority;

@end</pre><p></p>
<p>{filelink=3}</p>
]]></content:encoded>
			<wfw:commentRss>http://iosconsultancy.co.uk/2012/02/06/video-tutorial-create-a-tasks-application-from-the-ground-up-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visit iOSConsultancy.co.uk on Your Mobile</title>
		<link>http://iosconsultancy.co.uk/2012/02/05/visit-iosconsultancy-co-uk-on-your-mobile/</link>
		<comments>http://iosconsultancy.co.uk/2012/02/05/visit-iosconsultancy-co-uk-on-your-mobile/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 16:56:55 +0000</pubDate>
		<dc:creator>Matthew Casey</dc:creator>
				<category><![CDATA[Site News]]></category>
		<category><![CDATA[androad]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[iosconsultancy]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[new]]></category>
		<category><![CDATA[optimised]]></category>

		<guid isPermaLink="false">http://www.iosconsultancy.co.uk/?p=442</guid>
		<description><![CDATA[<p>iOSConsultancy.co.uk has a much improved interface for mobile visitors. Visit this website on an iOS mobile device (excluding iPad) and we now have an optimised version of the site just for you. Feel free to explore and leave a comment on this post letting us know your thoughts. As an added extra, iPhone and iPod [...]</p>
 ]]></description>
			<content:encoded><![CDATA[<p>iOSConsultancy.co.uk has a much improved interface for mobile visitors. Visit this website on an iOS mobile device (excluding iPad) and we now have an optimised version of the site just for you. Feel free to explore and leave a comment on this post letting us know your thoughts.</p>
<div id="attachment_444" class="wp-caption aligncenter" style="width: 169px"><a href="http://image.iosconsultancy.co.uk/2012/02/Screen-Shot-2012-02-05-at-16.53.27.png"><img class="size-medium wp-image-444" src="http://image.iosconsultancy.co.uk/2012/02/Screen-Shot-2012-02-05-at-16.53.27-159x300.png" alt="" width="159" height="300" /></a><p class="wp-caption-text">Our Mobile Site</p></div>
<p>As an added extra, iPhone and iPod Touch users can visit our website and install our WebApp by going to the homepage and clicking add to home screen from the actions menu on mobile safari. Done!</p>
<div id="attachment_443" class="wp-caption aligncenter" style="width: 220px"><a href="http://image.iosconsultancy.co.uk/2012/02/Screen-Shot-2012-02-05-at-16.53.54.png"><img class="size-medium wp-image-443" src="http://image.iosconsultancy.co.uk/2012/02/Screen-Shot-2012-02-05-at-16.53.54-210x300.png" alt="" width="210" height="300" /></a><p class="wp-caption-text">Our iOS WebApp</p></div>
]]></content:encoded>
			<wfw:commentRss>http://iosconsultancy.co.uk/2012/02/05/visit-iosconsultancy-co-uk-on-your-mobile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial: Catching Exceptions to Help Debug Before Your Application Explodes</title>
		<link>http://iosconsultancy.co.uk/2012/02/01/tutorial-catching-exceptions-to-help-debug-before-your-application-explodes/</link>
		<comments>http://iosconsultancy.co.uk/2012/02/01/tutorial-catching-exceptions-to-help-debug-before-your-application-explodes/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 12:14:41 +0000</pubDate>
		<dc:creator>Matthew Casey</dc:creator>
				<category><![CDATA[Intermediate Tutorials]]></category>
		<category><![CDATA[breakpoint]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[exception]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.iosconsultancy.co.uk/?p=417</guid>
		<description><![CDATA[<p>This tutorial uses Xcode 4.2 One of the major problems iOS developers have is being able to work out where an exception is thrown. There are several ways that you can make debugging easier on yourself. Below is a couple of tips. Global Breakpoint One handy technique is to set a global breakpoint on all [...]</p>
 ]]></description>
			<content:encoded><![CDATA[<p><em>This tutorial uses Xcode 4.2</em></p>
<p>One of the major problems iOS developers have is being able to work out where an exception is thrown. There are several ways that you can make debugging easier on yourself. Below is a couple of tips.</p>
<h3>Global Breakpoint</h3>
<p>One handy technique is to set a global breakpoint on all exceptions raised. This can be done as follows:</p>
<div id="attachment_418" class="wp-caption alignright" style="width: 310px"><a href="http://image.iosconsultancy.co.uk/2012/02/Screen-Shot-2012-02-01-at-12.08.14.png"><img class="size-medium wp-image-418" src="http://image.iosconsultancy.co.uk/2012/02/Screen-Shot-2012-02-01-at-12.08.14-300x93.png" alt="" width="300" height="93" /></a><p class="wp-caption-text">Options For New Exception</p></div>
<p>Open Xcode and launch any project &#8211; it doesn&#8217;t matter what it is.</p>
<p>On the left hand sidebar select the sixth tab (the breakpoints navigator), and click add in the lower left hand corner.</p>
<p>Choose &#8220;Add Exception Breakpoint..&#8221; from the options. In the pop up make sure the drop down says &#8220;On Throw&#8221; and click done.</p>
<p>It will now have added a new breakpoint. Lets make this global so that it is on every project you open.</p>
<p>Right click the &#8220;All Exceptions&#8221; breakpoint and choose &#8220;Move Breakpoint To&#8221; and then &#8220;User&#8221;.</p>
<p>Thats it! Now whenever an exception is thrown you will see the exact line of code that causes it.</p>
<h3>Backtracing</h3>
<p>When you do encounter an exception and it pops up in the log it will have on the bottom line &#8220;(gdb)&#8221; and then a cursor. If you type &#8220;bt&#8221; here without the speech marks it will give you a list of what was executed before the exception was raised. This can help solve a lot of issues.</p>
<p>We hope this helped you out solving your problems!</p>
]]></content:encoded>
			<wfw:commentRss>http://iosconsultancy.co.uk/2012/02/01/tutorial-catching-exceptions-to-help-debug-before-your-application-explodes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome to iOS Application Development: Say Hello World!!!</title>
		<link>http://iosconsultancy.co.uk/2012/01/07/welcome-to-ios-application-development-say-hello-world/</link>
		<comments>http://iosconsultancy.co.uk/2012/01/07/welcome-to-ios-application-development-say-hello-world/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 20:38:33 +0000</pubDate>
		<dc:creator>Matthew Casey</dc:creator>
				<category><![CDATA[Beginner Tutorials]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[getting]]></category>
		<category><![CDATA[hello]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[iOS5]]></category>
		<category><![CDATA[started]]></category>
		<category><![CDATA[storyboard]]></category>
		<category><![CDATA[textfield]]></category>
		<category><![CDATA[UIAlertView]]></category>
		<category><![CDATA[UITextField]]></category>
		<category><![CDATA[view]]></category>
		<category><![CDATA[world]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.iosconsultancy.co.uk/?p=326</guid>
		<description><![CDATA[<p>This tutorial uses iOS 5 and Xcode 4.2 This tutorial is for the absolute beginner, it will go through downloading and installing the development tools and then building your first application. Any concepts that require a more detailed understanding will be explained in linked to articles. To begin your never ending journey of iOS Development [...]</p>
 ]]></description>
			<content:encoded><![CDATA[<p><em>This tutorial uses iOS 5 and Xcode 4.2</em></p>
<p>This tutorial is for the absolute beginner, it will go through downloading and installing the development tools and then building your first application. Any concepts that require a more detailed understanding will be explained in linked to articles. To begin your never ending journey of iOS Development click that more link!</p>
<p><span id="more-326"></span></p>
<h3>Pre-Requisities</h3>
<p>There are a few requirements we have to deal with first. The first is hardware and software related:</p>
<blockquote><p>Xcode 4.2 requires Mac OS X Lion and an Intel Based Mac &#8211; <a href="http://itunes.apple.com/gb/app/xcode/id448457090?mt=12">Download this from the Mac App Store</a></p></blockquote>
<p>We are not relying on you having any previous programming experience on the iOS or Mac platform, although previous programming experience would be preferable.</p>
<h3>Download and Install Xcode &#8211; Your New Home!</h3>
<p>Once you have downloaded Xcode 4.2 from the Mac App Store, open the &#8220;Install Xcode&#8221; application and follow the instructions to install. This installs not just Xcode, but the SDK&#8217;s for both iOS and Mac development as well as some utility applications.</p>
<p>Once installed, launch Xcode (/Developer/Applications).</p>
<h3>Introduction to Xcode</h3>
<p>Now that you have the development environment all set up, please <a title="Xcode 4.2 Tour" href="http://www.iosconsultancy.co.uk/xcode-4-2-tour/" target="_blank">watch this video</a> that explains the basics of Xcode and how it functions. Once you&#8217;ve done that, come back here to carry on.</p>
<h3>Creating your First Project</h3>
<p><a href="http://image.iosconsultancy.co.uk/2012/01/Screen-Shot-2012-01-07-at-18.49.40.png"><img class=" wp-image-328  alignright" src="http://image.iosconsultancy.co.uk/2012/01/Screen-Shot-2012-01-07-at-18.49.40-300x207.png" alt="" /></a></p>
<p>So lets get going with building our first application. Make sure Xcode is front and centre on your screen and you should be greeted with the screen to the right. If this doesn&#8217;t open it can be shown by going to Window &gt;Welcome to Xcode.</p>
<p>Click the &#8220;Create a New Xcode Project&#8221; which will guide you through creating a new project. For this tutorial we are going to build a simple <em>single screen iPhone application. </em>We do this by selecting the &#8220;Single View Application&#8221; from the Application (iOS) section. Click next to proceed. The next screen is asking you for a few details.</p>
<blockquote><p><strong>Product Name: </strong>This is your application name. When following tutorials on this website we recommend you use the same name as us so that everything should look the same if you come across problems in your coding.</p></blockquote>
<blockquote><p><strong>Company Identifier: </strong>This is a string that unequally identifies your company. For example com.mycompany</p></blockquote>
<blockquote><p><strong>Class Prefix: </strong>This is a short string that will be attached to all Classes you create in your project. You are responsible for adding this to any that you add after the project is initially created. This is good coding practice so that you know what class&#8217;s you have coded, and which are from frameworks etc. For example, some of Apple&#8217;s core classes use prefixes such as NS and UI</p></blockquote>
<blockquote><p><strong>Device Family: </strong>This is the device you intent the application to be for. iPhone (which includes iPod Touch), iPad or Universal (which is both).</p></blockquote>
<blockquote><p><strong>Use Storyboard: </strong>A storyboard is a file that allows you to graphically create all your user interfaces for this project. It is like a top-down plan of your entire application.</p></blockquote>
<blockquote><p><strong>Use Automatic Reference Counting: </strong>This is new to Xcode 4.2. This allows you, the developer, to focus on developing the logic in your application rather than spending countless hours on  memory management code. When you build your application, Xcode will automatically add all required &#8220;release&#8221;, &#8220;retain&#8221; and &#8220;autorelease&#8221; statements if you check this box.</p></blockquote>
<blockquote><p><strong>Include Unit Tests: </strong>This allows you to add files to your project that help automatically test your application.</p></blockquote>
<p><a href="http://image.iosconsultancy.co.uk/2012/01/Screen-Shot-2012-01-07-at-19.10.14.png"><img class=" wp-image-335  alignright" src="http://image.iosconsultancy.co.uk/2012/01/Screen-Shot-2012-01-07-at-19.10.14-300x203.png" alt="" /></a></p>
<p>So after that explanation, enter the following details for this tutorial:</p>
<p>Product Name: HelloThere</p>
<p>Company Identifier: com.mycompany</p>
<p>Class Prefix: IC</p>
<p>Device Family: iPhone</p>
<p>Use Storyboard: On</p>
<p>Use Automatic Reference Counting: On</p>
<p>Include Unit Tests: Off</p>
<p>Click next to proceed. Find someone to save your project (Xcode will automatically create a new folder to store the project in). Then click Create. Once done your new project will be opened.</p>
<p style="text-align: center;"><a href="http://image.iosconsultancy.co.uk/2012/01/Screen-Shot-2012-01-07-at-19.10.29.png"><img class=" wp-image-334 aligncenter" src="http://image.iosconsultancy.co.uk/2012/01/Screen-Shot-2012-01-07-at-19.10.29-300x211.png" alt="" /></a></p>
<p>&nbsp;</p>
<h3>What Are All These Files?</h3>
<p>When you created that project, Xcode creates a lot of files for you by default. It is easy at this stage to say &#8220;Right OK what next??&#8221;. We are going to quickly run through the files that are generated so that you know what is being done behind the scenes.</p>
<blockquote><p><strong>ICAppDelegate.h / ICAppDelegate.m</strong> &#8211; This is where you can put code that executes when the application opens, closes receives a phone call etc.</p></blockquote>
<blockquote><p><strong>MainStoryboard.storybaord </strong>- This is where we will create the graphical sides of our interfaces</p></blockquote>
<blockquote><p><strong>ICViewController.h / ICViewController.m </strong>- This is where we will place code to control our &#8220;single window&#8221;</p></blockquote>
<blockquote><p><strong><em>Supporting Files Folder </em></strong><em>- </em>In here is a bunch of files that help your application run and at this level you do not need to know what they do</p></blockquote>
<p>ICAppDelegate is a class, so is ICViewController. If you don&#8217;t know what a class or an object is, please read <a title="Objects and Classes" href="http://www.iosconsultancy.co.uk/objects-and-classes/" target="_blank">this article</a> now. Once completed come back to this tutorial to carry on.</p>
<h3>Configure our View in the Storyboard</h3>
<p>Your application knows that when it launches it should read in the MainStoryboard.storyboard file and load the interfaces. Take a look at this file now. In it you should see almost like graph paper with a single white rectangle with an iPhone status bar at the top. This is our first view. The faded arrow coming into it is the file telling the application that this is the initial view and should be loaded at application launch.</p>
<p style="text-align: center;"><a href="http://image.iosconsultancy.co.uk/2012/01/Screen-Shot-2012-01-07-at-19.27.26.png"><img class=" wp-image-337 aligncenter" src="http://image.iosconsultancy.co.uk/2012/01/Screen-Shot-2012-01-07-at-19.27.26-300x211.png" alt="" /></a></p>
<p>Why don&#8217;t we add something so that we can see the application working. In the bottom right corner there should be a series of tabs, select the third tab (Object Browser). Find a &#8220;Text Field&#8221; and drag it onto your view. Place it about two thirds of the way up the white rectangle and in the middle horizontally. It should snap to a blue centre guide. Use the little handles to resize the text view so that it is wider. Expand each side until it snaps to another blue guide. These guides represent Apple&#8217;s guides as to distances suitable for human fingers to touch from the edge of the screen. Once you have done this save your Storyboard and click run in the top left corner of Xcode. Voila!</p>
<div id="attachment_338" class="wp-caption aligncenter" style="width: 169px"><a href="http://image.iosconsultancy.co.uk/2012/01/Screen-Shot-2012-01-07-at-19.33.50.png"><img class="size-medium wp-image-338" src="http://image.iosconsultancy.co.uk/2012/01/Screen-Shot-2012-01-07-at-19.33.50-159x300.png" alt="" width="159" height="300" /></a><p class="wp-caption-text">Your Beautiful Text Field</p></div>
<p>&nbsp;</p>
<p>Try tapping the text field. This will bring up the keyboard for you to type. The application doesn&#8217;t do much else yet so lets head back to Xcode.</p>
<blockquote><p>This is the simulator by the way, a way to test your iPhone applications without an iPhone. Works just like an iPhone. Feel free to explore the built in applications.</p>
<p>&nbsp;</p></blockquote>
<h3>Flesh Out The User Interface</h3>
<p>We are going to add a few more elements from the Object Library to our user interface. Drag out two labels and a button. You can edit the text on a label or a button by double clicking. Arrange and resize these new elements to make your interface look like this.</p>
<div id="attachment_339" class="wp-caption aligncenter" style="width: 212px"><a href="http://image.iosconsultancy.co.uk/2012/01/Screen-Shot-2012-01-07-at-19.39.55.png"><img class="size-medium wp-image-339" src="http://image.iosconsultancy.co.uk/2012/01/Screen-Shot-2012-01-07-at-19.39.55-202x300.png" alt="" width="202" height="300" /></a><p class="wp-caption-text">The desired interface</p></div>
<p>Feel free to save and run your application to try out these new elements! But they don&#8217;t do anything yet! Lets change that! Select the &#8220;View Controller&#8221;, the easiest way to select this is to click the status bar. On the right hand side there are a series of inspectors (tabs at the top of the right sidebar). The fourth one allows you to change properties of the selected element. The third one allows you to set custom classes. Select this one. You will notice the class of the view controller is ICViewController. Just what we want! When our application loads this view from our Storyboard it will create an object from our ICViewController class as the controller for our view. Thats great! Save your storyboard!</p>
<h3>Ready, Steady, Code!</h3>
<p>Head to ICViewController.h. This is the interface file for our ICViewController class. We are going to add a property so that we can interact with our text field. Lets do this! Here is our ICViewController.h after the change with the added line highlighted.</p>
<p></p><pre class="crayon-plain-tag">#import

@interface ICViewController : UIViewController

@property (nonatomic, strong) IBOutlet UITextField *txtPersonName;

@end</pre><p></p>
<p>This line tells our class we have a property called txtPersonName and it will be a UITextField object. We also tell it that this will be connected to something in our Interface Builder using the &#8220;IBOutlet&#8221; keyword. The word nonatomic tells us that this property is not thread safe (don&#8217;t worry about this), and strong tells us that the object stored in this property should be retained in memory.</p>
<p>We also need to add a method that can be executed when the user taps the button. To do this add the following line:</p>
<p></p><pre class="crayon-plain-tag">#import

@interface ICViewController : UIViewController

@property (nonatomic, strong) IBOutlet UITextField *txtPersonName;

-(IBAction)buttonTapped:(id)sender;

@end</pre><p></p>
<p>This line tells our class that we are going to define a method called buttonTapped: and will accept one argument, sender that is an id (anything). The IBAction keyword tells the compiler the method will not return anything and will be something that is called from our Interface Builder in our storyboard.</p>
<p>Head over to ICViewController.m and we need to implement both our property and our method. The property is easy as we are going to use Objective-C&#8217;s @synthesize command to tell it to auto generate getters and setters for this property. It will even auto generate an instance variable to store the object in. Add the following line of code after the @implmentation line:</p>
<p></p><pre class="crayon-plain-tag">@implementation ICViewController

@synthesize txtPersonName = _txtPersonName;</pre><p></p>
<p>The method is going to be where we do most our coding, so lets add the empty method stub for now. Add this code just below your @synthesize:</p>
<p></p><pre class="crayon-plain-tag">@synthesize txtPersonName = _txtPersonName;

-(IBAction)buttonTapped:(id)sender {

}</pre><p></p>
<h3>Implement the ButtonTapped Method</h3>
<p>This is the main part of our application logic. We need to take the text from our text box (the name), add this into our message and then show the message to the user. We will use the following algorithm to do so:</p>
<ul>
<li>Create a string that says Hello There &lt;and then the persons name&gt;, how are you? From your favourite friend &lt;the current users name&gt;</li>
<li>Show an alert view with this message</li>
</ul>
<p>So lets first create our message string. We do this with the following code:</p>
<p></p><pre class="crayon-plain-tag">-(IBAction)buttonTapped:(id)sender {

NSString *ourMessage = [NSString stringWithFormat:@&quot;Hello there %@, how are you? From your favourite friend %@&quot;, self.txtPersonName.text, NSUserName()];

}</pre><p></p>
<p>Line 14 creates a string using a formatter string. It uses the string &#8220;Hello there %@, how are you? From your favourite friend %@&#8221; as a template string, and replaces the first &#8220;%@&#8221; with the text from the text field, and the second %@ with the current users name.</p>
<p>We then need to do something with this message. We are going to use a UIAlertView to show the message. Add the following code:</p>
<p></p><pre class="crayon-plain-tag">-(IBAction)buttonTapped:(id)sender {

NSString *ourMessage = [NSString stringWithFormat:@&quot;Hello there %@, how are you? From your favourite friend %@&quot;, self.txtPersonName.text, NSUserName()];

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@&quot;HelloThere!&quot; message:ourMessage delegate:nil cancelButtonTitle:@&quot;Oh hi!&quot; otherButtonTitles: nil];

[alertView show];

}</pre><p></p>
<p>Line 15 creates a new UIAlertView object that has a title of &#8220;HelloThere!&#8221; and the contents of ourMessage is used as the message. We don&#8217;t need to respond to what button was pressed, so we set delegate to nil. We want the close button to say &#8220;Oh hi!&#8221; and we don&#8217;t want any other buttons. Line 16 shows the alert view.</p>
<p>Thats it? Not quite. We still need to connect our code up to our interface. Lets do that now!</p>
<h3>Tie Everything Up!!</h3>
<p>Go back to your MainStoryboard.storyboard. We need to connect our txtPersonName property to our text field and our buttonTapped method to the touch event of the button.</p>
<p>Hold down the Control key and drag from the view controller to the text field, and select the txtPersonName property.</p>
<div id="attachment_352" class="wp-caption aligncenter" style="width: 166px"><a href="http://image.iosconsultancy.co.uk/2012/01/Screen-Shot-2012-01-07-at-20.28.12.png"><img class="size-full wp-image-352 " src="http://image.iosconsultancy.co.uk/2012/01/Screen-Shot-2012-01-07-at-20.28.12.png" alt="" width="156" height="76" /></a><p class="wp-caption-text">The txtPersonName outlet</p></div>
<p>Then hold down the Control key again and this time drag from the button to the view controller, and select the buttonTapped method.</p>
<div id="attachment_351" class="wp-caption aligncenter" style="width: 166px"><a href="http://image.iosconsultancy.co.uk/2012/01/Screen-Shot-2012-01-07-at-20.29.00.png"><img class="size-full wp-image-351" src="http://image.iosconsultancy.co.uk/2012/01/Screen-Shot-2012-01-07-at-20.29.00.png" alt="" width="156" height="124" /></a><p class="wp-caption-text">The buttonTapped: event connection</p></div>
<p>Thats it! All Connected! Save your storyboard, run your application and try it!</p>
<div id="attachment_354" class="wp-caption alignleft" style="width: 169px"><a href="http://image.iosconsultancy.co.uk/2012/01/Screen-Shot-2012-01-07-at-20.32.13.png"><img class="size-medium wp-image-354 " src="http://image.iosconsultancy.co.uk/2012/01/Screen-Shot-2012-01-07-at-20.32.13-159x300.png" alt="" width="159" height="300" /></a><p class="wp-caption-text">Our Finished Application</p></div>
<div id="attachment_353" class="wp-caption alignright" style="width: 169px"><a href="http://image.iosconsultancy.co.uk/2012/01/Screen-Shot-2012-01-07-at-20.32.16.png"><img class="size-medium wp-image-353 " src="http://image.iosconsultancy.co.uk/2012/01/Screen-Shot-2012-01-07-at-20.32.16-159x300.png" alt="" width="159" height="300" /></a><p class="wp-caption-text">Saying HelloThere!</p></div>
<p style="text-align: center;">How do you like it?</p>
<p style="text-align: center;">Its nice isn&#8217;t it?</p>
<p style="text-align: center;">That wraps up our tutorial for today, if you have any questions or feedback please do not hesitate to leave a comment. If you want to download the finished application, please register and the download will be available to you.</p>
<p style="text-align: center;">{filelink=2}</p>
]]></content:encoded>
			<wfw:commentRss>http://iosconsultancy.co.uk/2012/01/07/welcome-to-ios-application-development-say-hello-world/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

