<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Free Time Studios</title>
	
	<link>http://www.freetimestudios.com</link>
	<description />
	<lastBuildDate>Tue, 16 Feb 2010 05:56:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/FreeTimeStudios" /><feedburner:info uri="freetimestudios" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>SlapHappy!™ is Officially Released!</title>
		<link>http://feedproxy.google.com/~r/FreeTimeStudios/~3/bqOU-wXCa9E/</link>
		<comments>http://www.freetimestudios.com/2010/02/15/slaphappy%e2%84%a2-is-officially-released/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 05:54:46 +0000</pubDate>
		<dc:creator>Nathan Eror</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.freetimestudios.com/?p=361</guid>
		<description><![CDATA[
			
				
			
		It&#8217;s September 16th on the East Coast, and SlapHappy!&#8482; is now live in the US app store. I don&#8217;t know about other countries, yet, but I assume that if it is September 16th somewhere in your country, you can get it now.

To celebrate the launch, SlapHappy!&#8482; is on sale for $.99 for a limited time. [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.freetimestudios.com%2F2010%2F02%2F15%2Fslaphappy%25e2%2584%25a2-is-officially-released%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.freetimestudios.com%2F2010%2F02%2F15%2Fslaphappy%25e2%2584%25a2-is-officially-released%2F&amp;source=freetimestudios&amp;style=normal&amp;service=bit.ly" height="61" width="50" />
			</a>
		</div><p>It&#8217;s September 16th on the East Coast, and SlapHappy!&trade; is now live in the US app store. I don&#8217;t know about other countries, yet, but I assume that if it is September 16th somewhere in your country, you can get it now.</p>

<p>To celebrate the launch, SlapHappy!&trade; is on sale for $.99 for a limited time. Check out the trailer below and get it in the <a href="http://slaphappygame.com/itunes">App Store</a>!</p>

<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/tgMtlvWRoqc&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/tgMtlvWRoqc&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>

<p><a href="http://slaphappygame.com/itunes"><img src="http://www.freetimestudios.com/wp-content/uploads/man/AvailableOnTheAppStore.png"/></a></p>
<img src="http://feeds.feedburner.com/~r/FreeTimeStudios/~4/bqOU-wXCa9E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.freetimestudios.com/2010/02/15/slaphappy%e2%84%a2-is-officially-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.freetimestudios.com/2010/02/15/slaphappy%e2%84%a2-is-officially-released/</feedburner:origLink></item>
		<item>
		<title>Chat With Free Time Studios Founder, Nathan Eror, Today at 12PM CST!</title>
		<link>http://feedproxy.google.com/~r/FreeTimeStudios/~3/VPYcp_txLcQ/</link>
		<comments>http://www.freetimestudios.com/2010/01/26/chat-with-free-time-studios-founder-nathan-eror-today-at-12pm-cst/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 16:11:23 +0000</pubDate>
		<dc:creator>Nathan Eror</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.freetimestudios.com/?p=303</guid>
		<description><![CDATA[
			
				
			
		Nathan will be the subjet of the first 360&#124;idev speaker chat at 12PM CST today. This is a great opportunity to get a feel for his sessions at both 360&#124;idev in San Jose this April and at iPhoneDevCamp Houston this Saturday. Drop on in and ask away!
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.freetimestudios.com%2F2010%2F01%2F26%2Fchat-with-free-time-studios-founder-nathan-eror-today-at-12pm-cst%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.freetimestudios.com%2F2010%2F01%2F26%2Fchat-with-free-time-studios-founder-nathan-eror-today-at-12pm-cst%2F&amp;source=freetimestudios&amp;style=normal&amp;service=bit.ly" height="61" width="50" />
			</a>
		</div><p>Nathan will be the subjet of the first 360|idev speaker chat at 12PM CST today. This is a great opportunity to get a feel for his sessions at both <a href="http://360idev-nathane.eventbrite.com/" title="360|iDev San Jose - April 11-14, 2010">360|idev in San Jose this April</a> and at <a href="http://www.iphonedevcamphouston.com/" title="iPhoneDevCamp Houston">iPhoneDevCamp Houston</a> this Saturday. <a href="https://admin.na3.acrobat.com/_a204547676/nathaneror360idevsj/?refresh-parent=true">Drop on in</a> and ask away!</p>
<img src="http://feeds.feedburner.com/~r/FreeTimeStudios/~4/VPYcp_txLcQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.freetimestudios.com/2010/01/26/chat-with-free-time-studios-founder-nathan-eror-today-at-12pm-cst/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.freetimestudios.com/2010/01/26/chat-with-free-time-studios-founder-nathan-eror-today-at-12pm-cst/</feedburner:origLink></item>
		<item>
		<title>iPhoneDevCamp Houston Presented by Free Time Studios</title>
		<link>http://feedproxy.google.com/~r/FreeTimeStudios/~3/s4mtB769NjI/</link>
		<comments>http://www.freetimestudios.com/2010/01/12/iphonedevcamp-houston-presented-by-free-time-studios/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 17:00:35 +0000</pubDate>
		<dc:creator>Nathan Eror</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.freetimestudios.com/?p=288</guid>
		<description><![CDATA[
			
				
			
		2010 is shaping up to be an exciting year for those of us in the iPhone and mobile software business, and there is no better way to kick it off than with a free community event. Free Time Studios is proud to be a major sponsor and primary organizer of the first ever iPhoneDevCamp Houston. [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.freetimestudios.com%2F2010%2F01%2F12%2Fiphonedevcamp-houston-presented-by-free-time-studios%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.freetimestudios.com%2F2010%2F01%2F12%2Fiphonedevcamp-houston-presented-by-free-time-studios%2F&amp;source=freetimestudios&amp;style=normal&amp;service=bit.ly" height="61" width="50" />
			</a>
		</div><p>2010 is shaping up to be an exciting year for those of us in the iPhone and mobile software business, and there is no better way to kick it off than with a free community event. Free Time Studios is proud to be a major sponsor and primary organizer of the first ever <a href="http://www.iphonedevcamphouston.com/" title="iPhoneDevCamp Houston">iPhoneDevCamp Houston</a>. If you are in the general vicinity of Houston on the last weekend of January, this is a can&#8217;t miss event. There will be presentations for people of all skill levels covering app development and marketing. Whether you are a seasoned or hopeful iPhone developer, there will be something for you at iPhoneDevCamp Houston.</p>

<p>Also, make sure to get your sleep on Friday night because we will be hacking all night Saturday. Show up with your ideas and your laptop, and work with the top iPhone development talent in the Houston area. Caffeine and sustenance will be provided.</p>

<p>Join the all of people who have already registered and <a href="http://www.iphonedevcamphouston.com/register/" title="iPhoneDevCamp Houston   &raquo; Registration">sign up here</a>. It&#8217;s free.</p>

<p>Check out the <a href="http://www.iphonedevcamphouston.com/" title="iPhoneDevCamp Houston">iPhoneDevCamp Houston website</a> for more information.</p>
<img src="http://feeds.feedburner.com/~r/FreeTimeStudios/~4/s4mtB769NjI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.freetimestudios.com/2010/01/12/iphonedevcamp-houston-presented-by-free-time-studios/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.freetimestudios.com/2010/01/12/iphonedevcamp-houston-presented-by-free-time-studios/</feedburner:origLink></item>
		<item>
		<title>Introducing FTUtils: Open Source Utilities for iPhone Developers</title>
		<link>http://feedproxy.google.com/~r/FreeTimeStudios/~3/vm2P9vFsoN0/</link>
		<comments>http://www.freetimestudios.com/2010/01/05/introducing-ftutils-open-source-utilities-for-iphone-developers/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 19:33:13 +0000</pubDate>
		<dc:creator>Nathan Eror</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Core Animation]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.freetimestudios.com/?p=252</guid>
		<description><![CDATA[
			
				
			
		For my Core Animation presentation at 360idev last year, I created a bunch of sample code to show how simple and powerful Core Animation is. I also promised that I would update the sample code with even more advanced examples. That has not really happened (yet!), and it is time for me to atone.

I am [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.freetimestudios.com%2F2010%2F01%2F05%2Fintroducing-ftutils-open-source-utilities-for-iphone-developers%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.freetimestudios.com%2F2010%2F01%2F05%2Fintroducing-ftutils-open-source-utilities-for-iphone-developers%2F&amp;source=freetimestudios&amp;style=normal&amp;service=bit.ly" height="61" width="50" />
			</a>
		</div><p>For my <a href="http://www.freetimestudios.com/2009/10/02/core-animation-hands-on-360idev-yes-there-is-more/" title="Core Animation: Hands-On @ 360idev. Yes, There is More! | Free Time Studios">Core Animation presentation</a> at <a href="http://www.360idev.com/" title="360|iDev the Premiere iPhone developer conference in the world!">360idev</a> last year, I created a bunch of <a href="http://github.com/neror/CA360" title="neror's CA360 at master - GitHub">sample code</a> to show how simple and powerful Core Animation is. I also promised that I would update the sample code with even more advanced examples. That has not really happened (yet!), and it is time for me to atone.</p>

<p>I am very excited to officially release a collection of utility code that I have accumulated over the past year: <a href="http://ftutils.com/" title="FTUtils - Open Source Tools for iPhone Developers"><strong>FTUtils</strong></a>! It is the first dependency I add to all of my projects, and I have already received enthusiastic feedback from developers who have stumbled on the <a href="http://github.com/neror/ftutils" title="neror's ftutils at master - GitHub">github project</a>.</p>

<p>It probably comes as no surprise that the bulk of <strong>FTUtils</strong> contains enhancements and extensions to the Core Animation API (called FTAnimation). I use Core Animation a lot, and I have tried to find elegant ways to round off some of the sharper edges of the API. <strong>FTUtils</strong> is not only about Core Animation, though. It features:</p>

<ul>
<li>A category on <code>UIView</code> that puts 13+ canned animations only a method call away.</li>
<li>Access to the <code>CAAnimation</code> objects for the canned animations so you can mix and match them all you want.</li>
<li>Implementation of the target/action pattern for animation delegate callbacks. No more huge <code>animationDidStop:finished:</code> methods!</li>
<li>Simple chaining of an arbitrary number of animations.</li>
<li>Embedding of a pre or post animation delay directly in the <code>CAAnimation</code> object (useful for chaining).</li>
<li><code>performSelector*</code> methods built for calling delegates that elegantly handle non-existent selectors and allow the passing of primitives as parameters.</li>
<li>Simple methods for reversing arrays.</li>
<li>A collection of macros to make common code patterns simpler to use.</li>
</ul>

<p>Since I use <strong>FTUtils</strong> in all of my projects, it is updated regularly with bug fixes and new features. Currently, I am working hard at documenting the whole library at <a href="http://ftutils.com/" title="FTUtils">ftutils.com</a>, and I will be pushing updates to the site as I finish chunks of the docs.</p>

<p>The iPhone developer community is an active and friendly one, and it has been very good to me. I am glad to have something to give back. Also, for those of you <a href="http://360idev-nathane.eventbrite.com/" title="360|iDev San Jose - April 11-14, 2010 - Eventbrite">planning to attend 360idev this April</a> (you should go&#8230;really), I will be speaking about advanced uses of Core Animation including an explanation of how everything in FTAnimation works.</p>

<h2>One more thing&#8230;</h2>

<p>Here&#8217;s a screencast showing off the canned animations in <strong>FTUtils</strong>. The code for this app is in the <a href="http://github.com/neror/ftutils/tree/master/Examples/" title="Examples at master from neror's ftutils - GitHub">Examples directory</a> of the project.</p>

<p>Enjoy!</p>

<p><object height='385' width='480'><param name='movie' value='http://www.youtube.com/v/UMYP-qEKs9Q&#038;hl=en_US&#038;fs=1&#038;' /><param name='allowFullScreen' value='true' /><param name='allowscriptaccess' value='always' /><embed src='http://www.youtube.com/v/UMYP-qEKs9Q&#038;hl=en_US&#038;fs=1&#038;' allowfullscreen='true' type='application/x-shockwave-flash' allowscriptaccess='always' height='385' width='480' /></object></p>

<p><a href="http://www.iphonekicks.com/kick/?url=http%3a%2f%2fwww.freetimestudios.com%2f2010%2f01%2f05%2fintroducing-ftutils-open-source-utilities-for-iphone-developers%2f"><img src="http://www.iphonekicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.freetimestudios.com%2f2010%2f01%2f05%2fintroducing-ftutils-open-source-utilities-for-iphone-developers%2f" border="0" alt="kick it on iPhoneKicks.com" /></a></p>
<img src="http://feeds.feedburner.com/~r/FreeTimeStudios/~4/vm2P9vFsoN0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.freetimestudios.com/2010/01/05/introducing-ftutils-open-source-utilities-for-iphone-developers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.freetimestudios.com/2010/01/05/introducing-ftutils-open-source-utilities-for-iphone-developers/</feedburner:origLink></item>
		<item>
		<title>Core Data Tips for iPhone Devs Part 2: Better Error Messages</title>
		<link>http://feedproxy.google.com/~r/FreeTimeStudios/~3/0g7LcmRoTKg/</link>
		<comments>http://www.freetimestudios.com/2009/11/13/core-data-tips-for-iphone-devs-part-2-better-error-messages/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 22:13:46 +0000</pubDate>
		<dc:creator>Nathan Eror</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Core Data]]></category>
		<category><![CDATA[Core Data Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.freetimestudios.com/?p=204</guid>
		<description><![CDATA[
			
				
			
		Continuing our series of Core Data tips and tricks, we turn to error handling. All good developers know that error handling is an essential piece of quality software. Unfortunately for Cocoa developers, error handling can be a little cumbersome and verbose on our favorite platform. This is a small price to pay to be able [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.freetimestudios.com%2F2009%2F11%2F13%2Fcore-data-tips-for-iphone-devs-part-2-better-error-messages%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.freetimestudios.com%2F2009%2F11%2F13%2Fcore-data-tips-for-iphone-devs-part-2-better-error-messages%2F&amp;source=freetimestudios&amp;style=normal&amp;service=bit.ly" height="61" width="50" />
			</a>
		</div><p>Continuing our <a href="http://www.freetimestudios.com/cat/core-data/cd-tips-tricks/" title="Core Data Tips &amp; Tricks | Free Time Studios">series of Core Data tips and tricks</a>, we turn to error handling. All good developers know that error handling is an essential piece of quality software. Unfortunately for Cocoa developers, error handling can be a little cumbersome and verbose on our favorite platform. This is a small price to pay to be able to work with such outstanding libraries and APIs, but the constant code repetition can eat away at our keyboards. Frustratingly, the errors we work so hard to catch and handle are, sometimes, not useful at first glance. This is definitely the case when saving an <code>NSManagedObjectContext</code>.</p>

<h3>The Problem</h3>

<p>Early in development, the data model model changes often, and errors are inevitable. Forget to make a new attribute optional, and the code blows up while saving the context. Because I move pretty fast and change things often, this kind of stuff happens to me all the time. Core Data provides me this error message quite often:</p>

<p><code>Domain=NSCocoaErrorDomain Code=1560 UserInfo=0x14f5480 "Operation could not be completed. (Cocoa error 1560.)"</code></p>

<p>For the developer inexperienced with Core Data, this is a very disheartening message. It does not give us any indication of <em>what</em> went wrong or <em>how</em> we should attempt to fix the problem.</p>

<h3>The Solution</h3>

<p>It turns out that, if there is more than one error, Core Data puts an array of <code>NSError</code> objects in the <code>userInfo</code> dictionary with the key <code>NSDetailedErrorsKey</code>. This is not obvious, and it drove me crazy for a while until I turned to <a href="http://stackoverflow.com/" title="Stack Overflow">Stack Overflow</a> where someone else had already asked my question. There, someone named Charles provided <a href="http://stackoverflow.com/questions/1283960/iphone-core-data-unresolved-error-while-saving/1297157#1297157" title="iphone Core Data Unresolved error while saving - Stack Overflow">this solution</a> with code to get at the &#8220;real&#8221; error. Overjoyed, I turned the code into a macro, and I use it exclusively to save a context during development. Here is the macro:</p>


<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#define FT_SAVE_MOC(_ft_moc) \</span>
<span style="color: #a61390;">do</span> <span style="color: #002200;">&#123;</span> \
  <span style="color: #400080;">NSError</span><span style="color: #002200;">*</span> _ft_save_error; \
  <span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">!</span><span style="color: #002200;">&#91;</span>_ft_moc save<span style="color: #002200;">:&amp;</span>_ft_save_error<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span> \
    NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Failed to save to data store: %@&quot;</span>, <span style="color: #002200;">&#91;</span>_ft_save_error localizedDescription<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>; \
    <span style="color: #400080;">NSArray</span><span style="color: #002200;">*</span> _ft_detailedErrors <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>_ft_save_error userInfo<span style="color: #002200;">&#93;</span> objectForKey<span style="color: #002200;">:</span>NSDetailedErrorsKey<span style="color: #002200;">&#93;</span>; \
    <span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span>_ft_detailedErrors <span style="color: #002200;">!=</span> <span style="color: #a61390;">nil</span> <span style="color: #002200;">&amp;&amp;</span> <span style="color: #002200;">&#91;</span>_ft_detailedErrors count<span style="color: #002200;">&#93;</span> &gt; <span style="color: #2400d9;">0</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span> \
      <span style="color: #a61390;">for</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSError</span><span style="color: #002200;">*</span> _ft_detailedError <span style="color: #a61390;">in</span> _ft_detailedErrors<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span> \
        NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;DetailedError: %@&quot;</span>, <span style="color: #002200;">&#91;</span>_ft_detailedError userInfo<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>; \
      <span style="color: #002200;">&#125;</span> \
    <span style="color: #002200;">&#125;</span> \
    <span style="color: #a61390;">else</span> <span style="color: #002200;">&#123;</span> \
      NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;%@&quot;</span>, <span style="color: #002200;">&#91;</span>_ft_save_error userInfo<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>; \
    <span style="color: #002200;">&#125;</span> \
  <span style="color: #002200;">&#125;</span> \
<span style="color: #002200;">&#125;</span> <span style="color: #a61390;">while</span><span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#41;</span>;</pre></div></div>


<p>Now, whenever I need to save the context, I can do it safely and comfortably like so:</p>


<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">FT_SAVE_MOC<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>self managedObjectContext<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span></pre></div></div>


<p>This macro only prints the error messages, but all I want during development is error messages in the console. This code can easily be moved to a function or method to do more robust error handling in a production scenario, but that would fill an entire post on its own. <img src='http://www.freetimestudios.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/FreeTimeStudios/~4/0g7LcmRoTKg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.freetimestudios.com/2009/11/13/core-data-tips-for-iphone-devs-part-2-better-error-messages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.freetimestudios.com/2009/11/13/core-data-tips-for-iphone-devs-part-2-better-error-messages/</feedburner:origLink></item>
		<item>
		<title>Core Data Tips for iPhone Devs Part 1: Command Line Shortcuts</title>
		<link>http://feedproxy.google.com/~r/FreeTimeStudios/~3/wmw0lPZZVLE/</link>
		<comments>http://www.freetimestudios.com/2009/11/11/core-data-tips-for-iphone-devs-part-1-command-line-shortcuts/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 19:17:31 +0000</pubDate>
		<dc:creator>Nathan Eror</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Core Data]]></category>
		<category><![CDATA[Core Data Tips & Tricks]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.freetimestudios.com/?p=133</guid>
		<description><![CDATA[
			
				
			
		I recently finished migrating the data management backend for all of my games to Core Data from a custom sqlite implementation. This is part of my commitment to use more Apple APIs where it makes sense, and this one made a lot of sense. While the migration took me a couple of days, the benefits [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.freetimestudios.com%2F2009%2F11%2F11%2Fcore-data-tips-for-iphone-devs-part-1-command-line-shortcuts%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.freetimestudios.com%2F2009%2F11%2F11%2Fcore-data-tips-for-iphone-devs-part-1-command-line-shortcuts%2F&amp;source=freetimestudios&amp;style=normal&amp;service=bit.ly" height="61" width="50" />
			</a>
		</div><p>I recently finished migrating the data management backend for all of my games to Core Data from a custom sqlite implementation. This is part of my commitment to use more Apple APIs where it makes sense, and this one made a lot of sense. While the migration took me a couple of days, the benefits of using Core Data have already paid back that investment in improved performance and better data design. Among other things, my domain objects are now much more granular which allows me to pull only the little bits of data that I need when I need them. Core Data makes managing the relationships between all of these little domain objects dead simple. In other words, I don&#8217;t have to write any more <code>join</code> queries!</p>

<p>Core Data is a massive topic, and I have only begun to scratch the surface of its usefulnes. Still, I have found myself doing some repetitive tasks both at the command line and in code. Like any self respecting programmer, I hate repetitive tasks, and my Makefile and header file of macros have grown as a result. Since most of the shortcuts I have come up with will probably be useful to others, I am putting them together in a series of blog posts. This is the first of those posts.</p>

<h3>The Problem</h3>

<p>Core Data allows you to choose from multiple backend storage methods, and, other than having to choose a type, the data store is completely transparent. The recommended store on the iPhone is sqlite, and not only is it fast, but the schema generated by Core Data is fairly readable. Being able to poke around in the sqlite file was an immeasurable help while I was learning Core Data. The biggest problem is finding the sqlite database file. Every time you build and run your app in the simulator, the application directory is renamed with a new GUID which makes it really hard to find:</p>

<div id="attachment_146" class="wp-caption aligncenter" style="width: 414px"><a href="http://www.freetimestudios.com/wp-content/uploads/2009/10/SimulatorAppWhackAMole.png"><img src="http://www.freetimestudios.com/wp-content/uploads/2009/10/SimulatorAppWhackAMole.png" alt="Can you find your app?" title="Simulator App Whack-A-Mole" width="404" height="283" class="size-full wp-image-146" /></a><p class="wp-caption-text">Can you find your app?</p></div>

<h3>The Solution</h3>

<p>Thankfully, OS X has the full compliment of unix command line tools. Wrap the proper commands in a Makefile, and you have some instant command line Core Data database management tools. Unix to the rescue! Here are the four make targets that I use the most:</p>


<div class="wp_syntax"><div class="code"><pre class="make" style="font-family:monospace;">SQLITE_DB_FILE<span style="color: #004400;">=</span>AppData<span style="color: #004400;">.</span>sqlite
SIMULATOR_HOME<span style="color: #004400;">=$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">HOME</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>Library<span style="color: #004400;">/</span>Application\ Support<span style="color: #004400;">/</span>iPhone\ Simulator
&nbsp;
dbshell<span style="color: #004400;">:</span>
	find <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">SIMULATOR_HOME</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">-</span>name <span style="color: #CC2200;">&quot;$(SQLITE_DB_FILE)&quot;</span> <span style="color: #004400;">-</span>exec sqlite3 <span style="color: #004400;">&#123;</span><span style="color: #004400;">&#125;</span> <span style="color: #CC2200;">';'</span>
&nbsp;
killdb<span style="color: #004400;">:</span>
	find <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">SIMULATOR_HOME</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">-</span>name <span style="color: #CC2200;">&quot;$(SQLITE_DB_FILE)&quot;</span> <span style="color: #004400;">-</span>exec rm <span style="color: #004400;">&#123;</span><span style="color: #004400;">&#125;</span> <span style="color: #CC2200;">';'</span>
&nbsp;
dbschema<span style="color: #004400;">:</span>
	find <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">SIMULATOR_HOME</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">-</span>name <span style="color: #CC2200;">&quot;$(SQLITE_DB_FILE)&quot;</span> <span style="color: #004400;">-</span>exec sqlite3 <span style="color: #004400;">&#123;</span><span style="color: #004400;">&#125;</span> <span style="color: #004400;">.</span>schema <span style="color: #CC2200;">';'</span>
&nbsp;
dbdump<span style="color: #004400;">:</span>
	find <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">SIMULATOR_HOME</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">-</span>name <span style="color: #CC2200;">&quot;$(SQLITE_DB_FILE)&quot;</span> <span style="color: #004400;">-</span>exec sqlite3 <span style="color: #004400;">&#123;</span><span style="color: #004400;">&#125;</span> <span style="color: #004400;">.</span>dump <span style="color: #CC2200;">';'</span></pre></div></div>


<p>The target names should make their use self explanatory, but I&#8217;ll summarize them:</p>

<dl>
<dt><strong><code>dbshell</code></strong></dt>
<dd>Open up the sqlite command line shell with the Core Data database selected.</dd>

<dt><strong><code>killdb</code></strong></dt>
<dd>Delete the database file. This is useful if you&#8217;re making big changes to the schema and you would rather delete the whole database and start over rather than migrating the schema.</dd>

<dt><strong><code>dbschema</code></strong></dt>
<dd>Dumps the <code>CREATE</code> statements required to recreate the schema. This is useful to see how Core Data persists your object graph.</dd>

<dt><strong><code>dbdump</code></strong></dt>
<dd>Dumps the schema as <code>CREATE</code> statements and all of the data as <code>INSERT</code> statements.</dd>
</dl>

<p>There is nothing magical or difficult about these, but I have found them to be very useful while developing my data model.</p>
<img src="http://feeds.feedburner.com/~r/FreeTimeStudios/~4/wmw0lPZZVLE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.freetimestudios.com/2009/11/11/core-data-tips-for-iphone-devs-part-1-command-line-shortcuts/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.freetimestudios.com/2009/11/11/core-data-tips-for-iphone-devs-part-1-command-line-shortcuts/</feedburner:origLink></item>
		<item>
		<title>Core Animation: Hands-On @ 360idev. Yes, There is More!</title>
		<link>http://feedproxy.google.com/~r/FreeTimeStudios/~3/n6L52AfzxZM/</link>
		<comments>http://www.freetimestudios.com/2009/10/02/core-animation-hands-on-360idev-yes-there-is-more/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 22:03:14 +0000</pubDate>
		<dc:creator>Nathan Eror</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Core Animation]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.freetimestudios.com/?p=64</guid>
		<description><![CDATA[
			
				
			
		I was surprised and excited to see the standing room only turnout for my in depth Core Animation talk at 360idev this week. I thought it would be a popular topic, but Collin really got people fired up to learn more during his introductory talk. I was able to cover quite a bit of material [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.freetimestudios.com%2F2009%2F10%2F02%2Fcore-animation-hands-on-360idev-yes-there-is-more%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.freetimestudios.com%2F2009%2F10%2F02%2Fcore-animation-hands-on-360idev-yes-there-is-more%2F&amp;source=freetimestudios&amp;style=normal&amp;service=bit.ly" height="61" width="50" />
			</a>
		</div><p>I was surprised and excited to see the standing room only turnout for my in depth Core Animation talk at <a href="http://www.360idev.com/" title="360|iDev the Premiere iPhone developer conference in the world!">360idev</a> this week. I thought it would be a popular topic, but <a href="http://collindonnell.com/" title="Collin Donnell">Collin</a> really got people fired up to learn more during his introductory talk. I was able to cover quite a bit of material in my 80 minutes, and I got some awesome feedback from the developers in attendance. The most common thing I heard from developers was some variation of &#8220;I didn&#8217;t know I could do that!&#8221; or &#8220;You just saved me <em>X</em> lines of code!&#8221; It was simultaneously flattering and disappointing.</p>

<p><strong>SlapHappy!</strong> is written entirely with Core Animation, and I&#8217;ve dug deeper into the API than most people outside of Apple. I&#8217;d forgotten how much of the stuff I know was picked up through a combination of trial and error, debugging, digging into headers, and re-reading <a href="http://pragprog.com/titles/bdcora/core-animation-for-mac-os-x-and-the-iphone" title="The Pragmatic Bookshelf | Core Animation for Mac OS X and the iPhone">books</a> and documentation. I didn&#8217;t expect that others have been as intimate with Core Animation as I have, but I was still a little surprised to see the lights go on in people&#8217;s heads as I spoke.</p>

<p>My experience presenting at 360idev proved what I had suspected: Many iPhone developers look at Core Animation as a low level framework hidden inside the black box of UIKit. I&#8217;d like to change that perception. While you can write an entire iPhone app without even knowing that Core Animation exists, just a basic understanding and application of the API and its concepts can go a long way to separate your app from the other 85,000+ in the app store.</p>

<p>Since I was not able to cover everything I wanted to in my 80 minutes at 360idev, I am putting together a <a href="http://www.freetimestudios.com/cat/core-animation/" title="Core Animation | Free Time Studios">series of blog posts</a> with Core Animation tips, tricks, lessons learned, and code. Consider this the first in the series. I&#8217;ll kick it off with my slide deck and a link to the more than 1,400 lines of sample code I prepared for the presentation.</p>

<ul>
<li><strong>The Slide Deck:</strong> <a href="http://www.freetimestudios.com/wp-content/uploads/2009/10/NathanEror_CoreAnimation_360idev.pdf" title="">Core Animation Hands-On: Building Complex and Attractive Cocoa Touch Interfaces</a></li>
<li><strong>The Code:</strong> <a href="http://github.com/neror/CA360" title="neror's CA360 at master - GitHub">http://github.com/neror/CA360</a></li>
</ul>

<p>I will be adding to the sample code project as I work on this series so make sure to <a href="http://github.com/neror/CA360/toggle_watch">watch</a> the project on github. Also, if you have any burning Core Animation questions that you&#8217;d like to see covered in this series, drop me an email or add a comment to this post.</p>

<p>Oh, and thank you again <a href="http://lordbron.wordpress.com/" title="Tom&#8217;s Blog">Tom</a> and <a href="http://johnwilker.com/" title="Community, Code, Awesomeness">John</a> for giving me the opportunity to be a part of such a tremendous show!</p>
<img src="http://feeds.feedburner.com/~r/FreeTimeStudios/~4/n6L52AfzxZM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.freetimestudios.com/2009/10/02/core-animation-hands-on-360idev-yes-there-is-more/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.freetimestudios.com/2009/10/02/core-animation-hands-on-360idev-yes-there-is-more/</feedburner:origLink></item>
		<item>
		<title>Speaking at 360|iDev in Denver</title>
		<link>http://feedproxy.google.com/~r/FreeTimeStudios/~3/OJrWDLyn59k/</link>
		<comments>http://www.freetimestudios.com/2009/06/19/speaking-at-360idev-in-denver/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 21:00:49 +0000</pubDate>
		<dc:creator>Nathan Eror</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.freetimestudios.com/?p=48</guid>
		<description><![CDATA[
			
				
			
		I&#8217;ll be speaking about Core Animation at 360&#124;iDev in Denver this September. Here&#8217;s what I&#8217;ll be talking about:

Using Core Animation to Build Complex and Attractive Interfaces

Core Animation plays an integral role in the iPhone user interface and is responsible for much of its intuitiveness. Careful use of animation can make even an average app a [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.freetimestudios.com%2F2009%2F06%2F19%2Fspeaking-at-360idev-in-denver%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.freetimestudios.com%2F2009%2F06%2F19%2Fspeaking-at-360idev-in-denver%2F&amp;source=freetimestudios&amp;style=normal&amp;service=bit.ly" height="61" width="50" />
			</a>
		</div><p>I&#8217;ll be speaking about Core Animation at <a href="http://www.360idev.com/">360|iDev</a> in Denver this September. Here&#8217;s what I&#8217;ll be talking about:</p>

<p><strong>Using Core Animation to Build Complex and Attractive Interfaces</strong></p>

<p>Core Animation plays an integral role in the iPhone user interface and is responsible for much of its intuitiveness. Careful use of animation can make even an average app a joy to use. In this session you will learn how to effectively apply the features of Core Animation in your own apps. After a brief introduction to the principles behind Core Animation, you will learn how it is used in UIKit. Then, we will dig into the meat of Core Animation and how to use it effectively. Using the open source <a title="neror's ftutils at master - GitHub" href="http://github.com/neror/ftutils/tree/master">FTAnimationManager</a> as an example, you will learn how to tame some of the complexities of the Core Animation API. By the end of this session, you will be comfortable with Core Animation, and your apps will run more smoothly and be more visually appealing.</p>

<p>I hope to see you there. It&#8217;s going to be an outstanding 4 days!</p>
<img src="http://feeds.feedburner.com/~r/FreeTimeStudios/~4/OJrWDLyn59k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.freetimestudios.com/2009/06/19/speaking-at-360idev-in-denver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.freetimestudios.com/2009/06/19/speaking-at-360idev-in-denver/</feedburner:origLink></item>
		<item>
		<title>The SlapHappy!™ Beta is Coming Soon!</title>
		<link>http://feedproxy.google.com/~r/FreeTimeStudios/~3/gjQeiWiK0hI/</link>
		<comments>http://www.freetimestudios.com/2009/06/10/the-slaphappy-beta-is-coming-soon/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 23:21:59 +0000</pubDate>
		<dc:creator>Nathan Eror</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.freetimestudios.com/?p=33</guid>
		<description><![CDATA[
			
				
			
		I&#8217;m gearing up the the first beta of my first game, SlapHappy!&#8482;. For the moment, I&#8217;ll leave you to figure out what the game is all about from the title.

If you&#8217;d like to be a part of the beta program, head on over to the contact page and fill out the form.

More information to come [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.freetimestudios.com%2F2009%2F06%2F10%2Fthe-slaphappy-beta-is-coming-soon%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.freetimestudios.com%2F2009%2F06%2F10%2Fthe-slaphappy-beta-is-coming-soon%2F&amp;source=freetimestudios&amp;style=normal&amp;service=bit.ly" height="61" width="50" />
			</a>
		</div><p>I&#8217;m gearing up the the first beta of my first game, <strong>SlapHappy!&trade;</strong>. For the moment, I&#8217;ll leave you to figure out what the game is all about from the title.</p>

<p>If you&#8217;d like to be a part of the beta program, head on over to the <a title="Contact Us" href="http://www.freetimestudios.com/contact/">contact page</a> and fill out the form.</p>

<p>More information to come soon&#8230;</p>
<img src="http://feeds.feedburner.com/~r/FreeTimeStudios/~4/gjQeiWiK0hI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.freetimestudios.com/2009/06/10/the-slaphappy-beta-is-coming-soon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.freetimestudios.com/2009/06/10/the-slaphappy-beta-is-coming-soon/</feedburner:origLink></item>
	</channel>
</rss>
