<?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>Gierad Blogs &#187; iPhone SDK</title>
	<atom:link href="http://www.gierad.com/blog/category/engineering/mobility/iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gierad.com/blog</link>
	<description>because he dreams for the wisdom of an owl, but has a memory of a goldfish</description>
	<lastBuildDate>Sun, 08 Aug 2010 23:38:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Sneak Peek of iPhone OS 4.0</title>
		<link>http://www.gierad.com/blog/2010/05/14/sneak-peek-of-iphone-os-4-0/</link>
		<comments>http://www.gierad.com/blog/2010/05/14/sneak-peek-of-iphone-os-4-0/#comments</comments>
		<pubDate>Fri, 14 May 2010 18:36:10 +0000</pubDate>
		<dc:creator>gierad</dc:creator>
				<category><![CDATA[Mobility]]></category>
		<category><![CDATA[Random News]]></category>
		<category><![CDATA[iPhone SDK]]></category>

		<guid isPermaLink="false">http://www.gierad.com/blog/?p=147</guid>
		<description><![CDATA[On April 8, 2010, Apple introduced iPhone OS 4. It is Apple&#8217;s fourth major iteration of its limelight mobile operating system with over 100 new features, including the highly sought multi-tasking capability. The new version includes major user experience improvements,  including updates targeted to Enterprise customers. The new look of iPhone OS 4 includes a [...]]]></description>
			<content:encoded><![CDATA[<p>On April 8, 2010, Apple introduced iPhone OS 4. It is Apple&#8217;s fourth major iteration of its limelight mobile operating system with over 100 new features, including the highly sought multi-tasking capability. The new version includes major user experience improvements,  including updates targeted to Enterprise customers.</p>
<p style="text-align: center;"><img class="size-full wp-image-173 alignnone" title="01 - iPhone View" src="http://www.gierad.com/blog/wp-content/uploads/2010/05/01-iPhone-View1.jpg" alt="" width="232" height="445" /><span style="font-size: xx-small;"><em> </em></span></p>
<p style="text-align: center;"><span style="font-size: xx-small;"><em>The new look of iPhone OS 4 includes a 3D dock, and a  customizable wallpaper.</em></span></p>
<p>Apple illustrates the major updates of iPhone OS 4 into &#8220;tent poles&#8221; which are described in the next section.</p>
<p><strong>1. Multi-tasking</strong></p>
<p>This is perhaps the biggest update to iPhone OS 4. Make no mistake, the iPhone already supports multi-tasking on some of its native applications like Mail and iPod. However, it has closed this door to third-party applications because allowing them to run in the background affects the phone&#8217;s battery life and performance.</p>
<p>The big question to ask is: <em>how does iPhone OS 4 support multi-tasking without affecting performance</em>?</p>
<p>Rather than allowing applications to run freely in the background, Apple&#8217;s approach is to provide <em>a la carte</em> multi-tasking <em>services</em>. This ensures that an application will only use the multi-tasking function it needs without adulterating the performance of the entire device.</p>
<p>The multi-tasking services that are offered for iPhone OS 4 include:</p>
<ul>
<li><strong>Background Audio </strong>- this service will allow applications like <em>Pandora</em>, and <em>Ambience</em> to play audio on the background.<strong> </strong></li>
<li><strong>Voice Over IP </strong>- this service will allow applications like <em>Skype</em>, and <em>Fring</em> to receive VoIP calls even when the application is not running.<strong> </strong></li>
<li><strong>Background Location </strong>- this service will allow applications like <em>Loopt</em> and <em>FourSquare</em> to constantly update user location even when the application is not running. Instead of polling GPS data, this service will use triangulation to retrieve location.<strong> </strong></li>
<li><strong>Local Notifications </strong>- this service will allow productivity applications such as to-do lists and calendars to send notifications to the phone without having to use Apple&#8217;s Push Notification Service (PNS).<strong> </strong></li>
<li><strong>Task Finishing -</strong> this service will allow tasks that take a while to load (like uploading a picture on Facebook) to run in the background even when the application is not active.<strong> </strong></li>
<li><strong>Fast App Switching –</strong> this service will allow an application to save its entire state (i.e. state of a chess game) to enable users to swiftly change between applications without any delay.<strong> </strong></li>
</ul>
<p>With the iPhone OS 4 sporting new multi-tasking capabilities, there is a lot of creative potential for forthcoming applications.</p>
<p style="text-align: center;"><img class="size-full wp-image-169 aligncenter" title="02 - Background Apps" src="http://www.gierad.com/blog/wp-content/uploads/2010/05/02-Background-Apps.jpg" alt="" width="232" height="445" /> <img class="alignnone size-full wp-image-170" title="03 - Kill Background Apps" src="http://www.gierad.com/blog/wp-content/uploads/2010/05/03-Kill-Background-Apps.jpg" alt="" width="232" height="445" /></p>
<p style="text-align: center;"><span style="font-size: xx-small;"><em>With Multi-tasking, users can switch between apps at anytime by  double-clicking the home button. Running apps can be killed by tapping and holding  the app icon.</em></span></p>
<p><strong>2. </strong><strong>Enterprise</strong></p>
<p>Enterprises have long had rancorous feelings about supporting the iPhone. In iPhone OS 3, the iPhone had spotty support for key enterprise features that were critical to enterprise adoption.</p>
<p>The release of iPhone OS 4 provides some important updates that might entice Enterprise decision-makers to take a second look at the iPhone. These new features include:</p>
<ul>
<li>Data Protection</li>
<li>Wireless App Distribution</li>
<li>Improved Mail</li>
<li>Mobile Device Management</li>
<li>SSL VPN Support</li>
</ul>
<p><strong> </strong></p>
<p><strong>Other major features of iPhone OS 4 include:</strong><strong> </strong></p>
<p><strong>3. </strong><strong>Folders </strong></p>
<p><strong> </strong></p>
<p>Scrolling through multiple pages before finding that favorite application? Android users don&#8217;t have a problem with this. However, with iPhone OS 4, applications can be organized and grouped into folders. Dragging the application on top of another application automatically creates a folder, reducing clutter. This also increases the current limit of 180 applications to 2160.</p>
<p style="text-align: center;"><img class="size-full wp-image-177 aligncenter" title="04 - Folders" src="http://www.gierad.com/blog/wp-content/uploads/2010/05/04-Folders.jpg" alt="" width="232" height="445" /> <img class="alignnone size-full wp-image-178" title="05 - Folder Open" src="http://www.gierad.com/blog/wp-content/uploads/2010/05/05-Folder-Open.jpg" alt="" width="232" height="445" /><span style="font-size: xx-small;"><em> </em></span></p>
<p style="text-align: center;"><span style="font-size: xx-small;"><em>With Folders, apps can be organized to reduce clutter and  improve usability.</em></span></p>
<p><strong>4. </strong><strong>Even Better Mail </strong></p>
<p><strong> </strong></p>
<p>With iPhone OS 4, the Mail application now supports a unified inbox. It also includes support for viewing messages as threads, and opening attachments using third party applications.</p>
<p><strong>5. </strong><strong>iBooks</strong></p>
<p>Apple&#8217;s e-reader application that comes pre-installed on the iPad will be available to iPhone users with the update of iPhone OS 4. Similar to Amazon&#8217;s Kindle e-reader, a massive library of books can be purchased and downloaded straight from the iBooks application.<strong> </strong></p>
<p><strong>6. </strong><strong>Game</strong><strong> Center</strong></p>
<p>With Apple&#8217;s successful business model for game development and distribution, is not surprising why Nintendo calls them &#8220;the enemy of the future&#8221;. In a move to aggrandize its market share, Apple is providing a new social platform for its avid gamers by introducing Game Center on iPhone OS 4. With Game Center, users can play multiplayer games, view ranks, and chat with their favorite buddies similar to Xbox Live.</p>
<p style="text-align: center;"><img class="size-full wp-image-179 aligncenter" title="06 - Game Center" src="http://www.gierad.com/blog/wp-content/uploads/2010/05/06-Game-Center.jpg" alt="" width="232" height="445" /></p>
<p style="text-align: center;"><em><span style="font-size: xx-small;">Game Center provides a social platform for avid iPhone / iPod  touch gamers similar to Xbox Live.</span></em></p>
<p><strong>7. </strong><strong>iAd</strong></p>
<p>iAd is Apple&#8217;s new mobile advertising platform to help developers with revenue generation. Current ads found in most free iPhone applications resemble that of classic web banners where users are taken to an external website when clicked.  With iAds, apps can feature highly interactive ads that combine the emotion of TV with the interactivity of the web. Think of these ads as &#8220;micro-apps&#8221;, or an app within an app.</p>
<p><strong> </strong></p>
<p><strong>To wrap it up&#8230;<br />
</strong></p>
<p>iPhone OS 4 is a major update for the OS. The addition of multi-tasking capabilities, coupled with several improvements in the user experience puts the OS ahead of its competition. Apple claims to have the best implementation of multi-tasking among its competitors. Their name will be put to the test come June.</p>
<p>To learn more about the upcoming iPhone OS 4.0, visit the <a href="http://www.apple.com/iphone/preview-iphone-os/">Apple</a> website or watch the <a href="http://www.apple.com/quicktime/qtv/specialevent0410/" target="_blank">Keynote address</a> . If you are an official iPhone Developer, you can download a beta version of iPhone OS 4 from the developer portal.</p>
<hr size="1" />
]]></content:encoded>
			<wfw:commentRss>http://www.gierad.com/blog/2010/05/14/sneak-peek-of-iphone-os-4-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone OS 4.0 is Coming</title>
		<link>http://www.gierad.com/blog/2010/04/05/iphone-os-4-0-is-coming/</link>
		<comments>http://www.gierad.com/blog/2010/04/05/iphone-os-4-0-is-coming/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 19:56:59 +0000</pubDate>
		<dc:creator>gierad</dc:creator>
				<category><![CDATA[Mobility]]></category>
		<category><![CDATA[iPhone SDK]]></category>

		<guid isPermaLink="false">http://www.gierad.com/blog/?p=140</guid>
		<description><![CDATA[Apple has announced a surprise event on April 8th to reveal details on the much anticipated iPhone OS 4.0.  This event should spill the beans on multi-tasking support and other new features. Im curious to see what&#8217;s in store for the future of iPhone OS&#8230;]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gierad.com/blog/wp-content/uploads/2010/04/iphoneOS-e1270497392487.jpg"><img class="alignnone size-full wp-image-141" title="iphoneOS" src="http://www.gierad.com/blog/wp-content/uploads/2010/04/iphoneOS-e1270497392487.jpg" alt="" width="400" height="290" /></a></p>
<p>Apple has announced a surprise event on April 8th to reveal details on the much anticipated iPhone OS 4.0.  This event should spill the beans on multi-tasking support and other new features. Im curious to see what&#8217;s in store for the future of iPhone OS&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gierad.com/blog/2010/04/05/iphone-os-4-0-is-coming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone SDK: Dealing with .plist Files</title>
		<link>http://www.gierad.com/blog/2009/11/28/iphone-sdk-dealing-with-plist-files/</link>
		<comments>http://www.gierad.com/blog/2009/11/28/iphone-sdk-dealing-with-plist-files/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 15:25:13 +0000</pubDate>
		<dc:creator>gierad</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Engineering]]></category>
		<category><![CDATA[iPhone SDK]]></category>

		<guid isPermaLink="false">http://www.gierad.com/blog/?p=27</guid>
		<description><![CDATA[Loading Contents of .plist file to an Array The most straightforward method for dealing with .plist files is +[NSArray initWithContentsOfFile:path]. However, you need to specify the correct path of the plist file via [NSBundle pathForResource:plist ofType:]. Loading to a Dictionary To load the contents of a .plist file to a dictionary,  instantiate a NSDictionary or [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Loading Contents of .plist file to an Array</strong></p>
<p>The most straightforward method for dealing with .plist files is +[NSArray initWithContentsOfFile:path]. However, you need to specify the correct path of the plist file via [NSBundle pathForResource:plist ofType:].</p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="objc" style="font-family:monospace;"><span class="sy0">-</span> <span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/"><span class="kw5">NSArray</span></a> <span class="sy0">*</span><span class="br0">&#41;</span>arrayFromPlist<span class="sy0">:</span> <span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span><span class="br0">&#41;</span>plist <span class="br0">&#123;</span>
     <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span>path <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSBundle_Class/"><span class="kw5">NSBundle</span></a> mainBundle<span class="br0">&#93;</span> pathForResource<span class="sy0">:</span>plist ofType<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;plist&quot;</span><span class="br0">&#93;</span>;
     <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/"><span class="kw5">NSArray</span></a> <span class="sy0">*</span>array <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/"><span class="kw5">NSArray</span></a> alloc<span class="br0">&#93;</span> initWithContentsOfFile<span class="sy0">:</span>path<span class="br0">&#93;</span>;
     <span class="kw1">return</span> array;
 <span class="br0">&#125;</span></pre></div></div>
<p><strong>Loading to a Dictionary</strong></p>
<p>To load the contents of a .plist file to a dictionary,  instantiate a NSDictionary or NSMutableDictionary and initialize it with [NSDictionary initWithContentsOfFile:]</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco;"><div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="objc" style="font-family:monospace;"><span class="sy0">-</span> <span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/"><span class="kw5">NSDictionary</span></a> <span class="sy0">*</span><span class="br0">&#41;</span>dictionaryFromPlist<span class="sy0">:</span> <span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span><span class="br0">&#41;</span>plist <span class="br0">&#123;</span>
 <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span>path <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSBundle_Class/"><span class="kw5">NSBundle</span></a> mainBundle<span class="br0">&#93;</span> pathForResource<span class="sy0">:</span>plist ofType<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;plist&quot;</span><span class="br0">&#93;</span>;
 <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/"><span class="kw5">NSDictionary</span></a> <span class="sy0">*</span>dict <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/"><span class="kw5">NSDictionary</span></a> alloc<span class="br0">&#93;</span> initWithContentsOfFile<span class="sy0">:</span>path<span class="br0">&#93;</span>;
 <span class="kw1">return</span> dict;
<span class="br0">&#125;</span></pre></div></div></p>
<p><strong>Writing to a .plist</strong></p>
<p>The easiest way to write values to a .plist file is to use a NSDictionary and modify its contents using -[NSDictionary setObject: forKey:]. To save the contents to a .plist file, use -[NSDictionary writeToFile: atomically:].</p>
<p>Atomically writing to a file guarantees that the file, if it exists at all, does not become corrupted even when the system should crash while writing.</p>
<p style="font: normal normal normal 10px/normal Monaco; margin: 0px;"><div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="objc" style="font-family:monospace;"><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span>path <span class="sy0">=</span> <span class="co3">@</span><span class="st0">&quot;Path to Plist.plist&quot;</span>;
 <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/"><span class="kw5">NSDictionary</span></a> <span class="sy0">*</span>dict <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/"><span class="kw5">NSDictionary</span></a> alloc<span class="br0">&#93;</span> initWithContentsOfFile<span class="sy0">:</span>path<span class="br0">&#93;</span>;
<span class="br0">&#91;</span>dict setObject<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;Gierad&quot;</span> forKey<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;name&quot;</span><span class="br0">&#93;</span>;
<span class="br0">&#91;</span>dict writeToFile<span class="sy0">:</span>path atomically<span class="sy0">:</span><span class="kw2">YES</span><span class="br0">&#93;</span>;</pre></div></div></p>
<p>Lastly, if you want to read/write small configurations for your app, <em>NSUserDefaults</em> is recommended. It contains methods to easily handle key-value pairs including floats and other objects.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco;">
]]></content:encoded>
			<wfw:commentRss>http://www.gierad.com/blog/2009/11/28/iphone-sdk-dealing-with-plist-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
