<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Pat Zearfoss</title>
	<atom:link href="http://zearfoss.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://zearfoss.wordpress.com</link>
	<description>My Musings</description>
	<lastBuildDate>Wed, 22 Feb 2012 03:04:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='zearfoss.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/43d1cc5384c6ce5546eda09fbdd67257?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Pat Zearfoss</title>
		<link>http://zearfoss.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://zearfoss.wordpress.com/osd.xml" title="Pat Zearfoss" />
	<atom:link rel='hub' href='http://zearfoss.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Taming NSDate-Utilities</title>
		<link>http://zearfoss.wordpress.com/2012/02/21/taming-nsdate-utilities/</link>
		<comments>http://zearfoss.wordpress.com/2012/02/21/taming-nsdate-utilities/#comments</comments>
		<pubDate>Wed, 22 Feb 2012 03:04:45 +0000</pubDate>
		<dc:creator>pzearfoss</dc:creator>
				<category><![CDATA[Libraries]]></category>
		<category><![CDATA[libraries]]></category>
		<category><![CDATA[nscalendar]]></category>
		<category><![CDATA[NSDate]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://zearfoss.wordpress.com/?p=335</guid>
		<description><![CDATA[NSDate-Utilities is a part of a great library for working with NSCalendar and NSDate. It provides uber-convenient methods on NSDate for finding out, for example, whether the NSDate receiver falls within the current day. These utilities are fantastic, but unfortunately, they&#8217;re also a bit on the slow side. Why so slow? Many of the methods [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zearfoss.wordpress.com&amp;blog=20463411&amp;post=335&amp;subd=zearfoss&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a title="NSDate-Extensions on GitHub" href="https://github.com/erica/NSDate-Extensions">NSDate-Utilities</a> is a part of a great library for working with NSCalendar and NSDate. It provides uber-convenient methods on NSDate for finding out, for example, whether the NSDate receiver falls within the current day. These utilities are fantastic, but unfortunately, they&#8217;re also a bit on the slow side.</p>
<h2>Why so slow?</h2>
<p>Many of the methods rely on getting NSDateComponents from a date via the NSCalendar. Each sends an independent call to [NSCalendar currentCalendar]. Unfortunately, getting the current calendar seems really slow. The latest SalesBag release will feature a very robust set of calendar views to help salespeople schedule their meetings. This means a ton of calculations on NSDate inside tight loops. Using the NSDate-Utilities methods and the time profiler, I found the app spending nearly half a second in [NSCalendar currentCalendar]. This is not good.</p>
<h2>Diagnosis</h2>
<p>The NSDate-Utilities methods that spend time with NSCalendar all call out to [NSCalendar currentCalendar] independently. For general use, this is probably fine and leaves the app a little leaner on memory. It also (seems to) guarantee that the calendar will always be right if the user changes it mid stream in the app. For Salesbag, this won&#8217;t be a problem. We assume that salespeople in the US will be using the gregorian calendar.</p>
<h2>Fixing</h2>
<p>To speed things up I first created a static NSCalendar variable at the top of the m file that we&#8217;ll use in place of grabbing NSCalendar fresh every time.</p>
<p><pre class="brush: objc;">
static NSCalendar *curCalendar = nil;
</pre></p>
<p>Then I replaced the #define for current calendar with my static variable</p>
<p><pre class="brush: objc;">
#define CURRENT_CALENDAR curCalendar
</pre></p>
<p>Lastly, I need to create the calendar when needed. For this I created a new macro that I placed at the head of any method using the CURRENT_CALENDAR macro:</p>
<p><pre class="brush: objc;">
#define INIT_CURRENT_CALENDAR if (curCalendar == nil) curCalendar = [[NSCalendar currentCalendar] retain];

// later ...
- (BOOL) isSameYearAsDate: (NSDate *) aDate
{
    INIT_CURRENT_CALENDAR
	NSDateComponents *components1 = [CURRENT_CALENDAR components:NSYearCalendarUnit fromDate:self];
	NSDateComponents *components2 = [CURRENT_CALENDAR components:NSYearCalendarUnit fromDate:aDate];
	return ([components1 year] == [components2 year]);
}
</pre></p>
<h2>Improvement</h2>
<p>The time profiler showed the time spent in [NSCalendar currentCalendar] dropped to a measly 35ms. Something I can certainly live with. Of course there&#8217;s no such thing as a free lunch and any developer would point out that my static won&#8217;t be deallocated until the app terminates. In this case though, the memory trade off was worth it for the speed increase.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zearfoss.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zearfoss.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zearfoss.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zearfoss.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zearfoss.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zearfoss.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zearfoss.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zearfoss.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zearfoss.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zearfoss.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zearfoss.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zearfoss.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zearfoss.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zearfoss.wordpress.com/335/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zearfoss.wordpress.com&amp;blog=20463411&amp;post=335&amp;subd=zearfoss&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zearfoss.wordpress.com/2012/02/21/taming-nsdate-utilities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/db4f7b370eadc859c1c32d417ce0b541?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pzearfoss</media:title>
		</media:content>
	</item>
		<item>
		<title>2011 in review</title>
		<link>http://zearfoss.wordpress.com/2012/01/06/2011-in-review/</link>
		<comments>http://zearfoss.wordpress.com/2012/01/06/2011-in-review/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 18:34:42 +0000</pubDate>
		<dc:creator>pzearfoss</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://zearfoss.wordpress.com/?p=331</guid>
		<description><![CDATA[This is admittedly pretty cool: &#160; The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog. Here&#8217;s an excerpt: The concert hall at the Sydney Opera House holds 2,700 people. This blog was viewed about 12,000 times in 2011. If it were a concert at Sydney Opera House, it would take about [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zearfoss.wordpress.com&amp;blog=20463411&amp;post=331&amp;subd=zearfoss&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is admittedly pretty cool:</p>
<p>&nbsp;</p>
<p>The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog.</p>
<p><a href="/2011/annual-report/"><img src="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg" alt="" width="100%" /></a></p>
<p>Here&#8217;s an excerpt:</p>
<blockquote><p>The concert hall at the Sydney Opera House holds 2,700 people. This blog was viewed about <strong>12,000</strong> times in 2011. If it were a concert at Sydney Opera House, it would take about 4 sold-out performances for that many people to see it.</p></blockquote>
<p><a href="/2011/annual-report/">Click here to see the complete report.</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zearfoss.wordpress.com/331/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zearfoss.wordpress.com/331/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zearfoss.wordpress.com/331/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zearfoss.wordpress.com/331/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zearfoss.wordpress.com/331/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zearfoss.wordpress.com/331/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zearfoss.wordpress.com/331/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zearfoss.wordpress.com/331/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zearfoss.wordpress.com/331/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zearfoss.wordpress.com/331/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zearfoss.wordpress.com/331/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zearfoss.wordpress.com/331/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zearfoss.wordpress.com/331/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zearfoss.wordpress.com/331/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zearfoss.wordpress.com&amp;blog=20463411&amp;post=331&amp;subd=zearfoss&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zearfoss.wordpress.com/2012/01/06/2011-in-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/db4f7b370eadc859c1c32d417ce0b541?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pzearfoss</media:title>
		</media:content>

		<media:content url="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg" medium="image" />
	</item>
		<item>
		<title>2012 &#8211; A look back and a look forward</title>
		<link>http://zearfoss.wordpress.com/2012/01/06/2012-a-look-back-and-a-look-forward/</link>
		<comments>http://zearfoss.wordpress.com/2012/01/06/2012-a-look-back-and-a-look-forward/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 12:00:25 +0000</pubDate>
		<dc:creator>pzearfoss</dc:creator>
				<category><![CDATA[idevblogaday]]></category>
		<category><![CDATA[Other]]></category>
		<category><![CDATA[goals]]></category>
		<category><![CDATA[new year]]></category>

		<guid isPermaLink="false">http://zearfoss.wordpress.com/?p=327</guid>
		<description><![CDATA[Another day, another dollar.  Another year, another . . . something. Dunno.  I&#8217;ve never had much use for resolutions related to an arbitrary day of the year.  I tend to see goal setting as an ongoing thing and goals as more of a continual series of milestones rather than a single achievable event.  Why new [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zearfoss.wordpress.com&amp;blog=20463411&amp;post=327&amp;subd=zearfoss&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Another day, another dollar.  Another year, another . . . something.</p>
<p>Dunno.  I&#8217;ve never had much use for resolutions related to an arbitrary day of the year.  I tend to see goal setting as an ongoing thing and goals as more of a continual series of milestones rather than a single achievable event.  Why new years resolutions anyway?  Why not 6-month resolutions?  Or monthly resolutions?  Monthly resolutions in agile sprints?  Maybe I&#8217;m onto something . . .</p>
<p>Most of the stuff I put up here is highly technical in nature.  Tutorials on how to do this or that in iOS or XCode.  I was tempted to go technical on this one too.  A rambling list of technologies I&#8217;ve worked with.  Another xxxKit.framework I intend to plod around with.</p>
<p>Boring.  Who cares.</p>
<p>That in itself isn&#8217;t really interesting to anyone (not even me really).  So in a different direction I&#8217;m taking stock of what I&#8217;m good at, what I&#8217;m not good at, and what I want to be better at on a very general level.  I think these could apply to anyone working as developer whether working on an indie project (as many people reading iDevBlogADay probably are) or working on client work (as I do).</p>
<p><strong>Things I&#8217;m Good At</strong>:</p>
<p><strong>Watching the details</strong> &#8211; It came to me in an epiphany this year.  Strangely.  I am a detail oriented person.  I was never the kid with a clean room.  I never meticulously organized my closet by color.  I never had the border-line OCD, must-organize-everything kind of personality.  I still don&#8217;t.  On some level I separate ordinary details from Details That Matter.</p>
<p>At any rate, I have a penchant for the details when it comes to my work.  I like this.  I love this.  I used to be envious of the detail oriented folk.  I&#8217;m pleased to count myself among them in some regard.  I think this is necessary for people who work as developers.  Your job is detail oriented.  &#8220;The computer will only do exactly what you tell it&#8221;, my dad used to say.  To a fault.  I take pride in the craftsmanship of my work.  I always have.  2012 will be no different.</p>
<p><strong>Making a plan</strong> &#8211; 2012 was one of my first forays in developing a real, honest-to-god software engineering plan.  I thought I&#8217;d nailed it.  Turns out I was about 75% of the way there (the gaps really showed up during development).  Regardless the parts that <em>were </em>planned well went off without much of a hitch and came in under-time against the project plan.  This is something I want to expand upon in 2012.  You&#8217;d be amazed what you can figure out ahead of time before you write one line of code.  Every 15 minute interval spent mulling over a problem before you start will save probably hours in development when the same problem inevitably comes up.  As mine and Mindgrub&#8217;s projects grow ever larger this will become increasingly more important.</p>
<p><strong>Things I Suck At (and want to improve upon):</strong></p>
<p><strong>Automating the mundane</strong> &#8211; Shame on me as a developer, but there&#8217;s a lot of things for which I don&#8217;t have automation in place.  Simple stuff.  Dumb stuff.  Stupid stuff I still do manually like pushing a build to test flight or setting up a UITableView.  I think there&#8217;s a couple reasons I haven&#8217;t delved into this more.</p>
<ol>
<li>Time is not always on my side, in that the pressure to just get the client work out the door is high to where I don&#8217;t think I&#8217;ll have time to find/write a script or an automator action or make an XCode template.  Usually by the time I notice that I should have automated it I&#8217;m already 75% done with the task.</li>
<li>Fear of the tools &#8211; What if automator jacks the upload to testflight?  What if the deployment script fails?  Dumb fear.  Paranoia.  I need to get over this one.</li>
<li>Lack of knowledge &#8211; In no way can I count myself as a bash guru.  I couldn&#8217;t write a Perl script to save my life.  Granted automator is a huge help here.  In some ways you can put this under &#8220;fear of the tools&#8221;</li>
</ol>
<p>Not sure if there&#8217;s an easy solution here.  First would be to learn the tools: automator, a little bash.  I think I&#8217;ll leave Perl until 2013.  I also have a mind to make a slew of Xcode templates to use with my development team as it always seems there&#8217;s a bunch of things we have to add to any UIViewController.  Third for me is to try out tools and scripts that get posted to various places like HackerNews and Twitter, see what other folks are doing and try to adopt them into my and my team&#8217;s workflow.</p>
<p><strong>Branch Out</strong> &#8211; I&#8217;ve been working with iOS almost exclusively in 2011.  It&#8217;s great and I love it but I&#8217;ve been feeling the need to branch out lately.  I believe it&#8217;s important especially in the current job market to be versatile as a developer.  Learning new programming languages will make you better at whichever language you use everyday.  Learning new frameworks will make you think differently about the frameworks you already use.  And if you don&#8217;t learn anything new, technology will pass you by.  For 2012 I want to get a release of a cocoa app.  While it&#8217;s still objective-c, there&#8217;s a lot of nuanced differences between the two.  I&#8217;ve got a couple of ideas rattling around, just gotta get up and get going on one.</p>
<p><strong>Making every moment count</strong> &#8211; I feel like I need a little more get up and go in my life.  Not that I&#8217;m lazy.  Far from it.  But I want to make more of my free time that I have.  That doesn&#8217;t necessarily mean more work or side projects but more about getting the feeling that I&#8217;m getting most out of every minute.  This year I want to work on paring down distractions and focus more on important things.</p>
<p>So, maybe this process was a little more cathartic than I thought looking at the tone of the post from the top to the bottom.  At any rate I want to wish those few regular readers and folks from iDevBlogADay a great new year.  Happy Coding!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zearfoss.wordpress.com/327/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zearfoss.wordpress.com/327/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zearfoss.wordpress.com/327/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zearfoss.wordpress.com/327/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zearfoss.wordpress.com/327/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zearfoss.wordpress.com/327/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zearfoss.wordpress.com/327/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zearfoss.wordpress.com/327/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zearfoss.wordpress.com/327/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zearfoss.wordpress.com/327/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zearfoss.wordpress.com/327/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zearfoss.wordpress.com/327/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zearfoss.wordpress.com/327/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zearfoss.wordpress.com/327/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zearfoss.wordpress.com&amp;blog=20463411&amp;post=327&amp;subd=zearfoss&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zearfoss.wordpress.com/2012/01/06/2012-a-look-back-and-a-look-forward/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/db4f7b370eadc859c1c32d417ce0b541?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pzearfoss</media:title>
		</media:content>
	</item>
		<item>
		<title>Finally Own an iPhone</title>
		<link>http://zearfoss.wordpress.com/2012/01/01/finally-own-an-iphone/</link>
		<comments>http://zearfoss.wordpress.com/2012/01/01/finally-own-an-iphone/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 19:31:30 +0000</pubDate>
		<dc:creator>pzearfoss</dc:creator>
				<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">http://zearfoss.wordpress.com/?p=324</guid>
		<description><![CDATA[My dirty little secret as a developer is that I&#8217;ve been an Android user for the past 2 years.  I finally upgraded this week to an iPhone.  I can&#8217;t begin to describe how much better the experience it is!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zearfoss.wordpress.com&amp;blog=20463411&amp;post=324&amp;subd=zearfoss&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My dirty little secret as a developer is that I&#8217;ve been an Android user for the past 2 years.  I finally upgraded this week to an iPhone.  I can&#8217;t begin to describe how much better the experience it is!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zearfoss.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zearfoss.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zearfoss.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zearfoss.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zearfoss.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zearfoss.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zearfoss.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zearfoss.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zearfoss.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zearfoss.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zearfoss.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zearfoss.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zearfoss.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zearfoss.wordpress.com/324/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zearfoss.wordpress.com&amp;blog=20463411&amp;post=324&amp;subd=zearfoss&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zearfoss.wordpress.com/2012/01/01/finally-own-an-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/db4f7b370eadc859c1c32d417ce0b541?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pzearfoss</media:title>
		</media:content>
	</item>
		<item>
		<title>UIView Subclass for Custom Drawing Using Blocks</title>
		<link>http://zearfoss.wordpress.com/2011/12/29/uiview-subclass-for-custom-drawing-using-blocks/</link>
		<comments>http://zearfoss.wordpress.com/2011/12/29/uiview-subclass-for-custom-drawing-using-blocks/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 15:49:07 +0000</pubDate>
		<dc:creator>pzearfoss</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zearfoss.wordpress.com/?p=320</guid>
		<description><![CDATA[UnderTheBridge picked up a post on a clever method for using blocks for drawing.  Especially useful for small views that don&#8217;t do anything else other than just custom drawing. Check out the original post from David Hamrick here.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zearfoss.wordpress.com&amp;blog=20463411&amp;post=320&amp;subd=zearfoss&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.alexcurylo.com/blog/">UnderTheBridge</a> picked up a post on a clever method for using blocks for drawing.  Especially useful for small views that don&#8217;t do anything else other than just custom drawing.</p>
<p>Check out the original post from <a href="http://www.davidhamrick.com/">David Hamrick</a> <a href="http://www.davidhamrick.com/2011/08/07/using-blocks-for-drawing-to-avoid-subclasssing-in-objective-c.html">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zearfoss.wordpress.com/320/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zearfoss.wordpress.com/320/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zearfoss.wordpress.com/320/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zearfoss.wordpress.com/320/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zearfoss.wordpress.com/320/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zearfoss.wordpress.com/320/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zearfoss.wordpress.com/320/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zearfoss.wordpress.com/320/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zearfoss.wordpress.com/320/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zearfoss.wordpress.com/320/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zearfoss.wordpress.com/320/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zearfoss.wordpress.com/320/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zearfoss.wordpress.com/320/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zearfoss.wordpress.com/320/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zearfoss.wordpress.com&amp;blog=20463411&amp;post=320&amp;subd=zearfoss&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zearfoss.wordpress.com/2011/12/29/uiview-subclass-for-custom-drawing-using-blocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/db4f7b370eadc859c1c32d417ce0b541?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pzearfoss</media:title>
		</media:content>
	</item>
		<item>
		<title>Multiple Build Targets For Fun and Profit</title>
		<link>http://zearfoss.wordpress.com/2011/12/23/multiple-build-targets-for-fun-and-profit/</link>
		<comments>http://zearfoss.wordpress.com/2011/12/23/multiple-build-targets-for-fun-and-profit/#comments</comments>
		<pubDate>Sat, 24 Dec 2011 02:50:34 +0000</pubDate>
		<dc:creator>pzearfoss</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[idevblogaday]]></category>
		<category><![CDATA[Methods]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[schemes]]></category>
		<category><![CDATA[targets]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://zearfoss.wordpress.com/?p=307</guid>
		<description><![CDATA[This month Mindgrub and Wheelhouse Analytics released Salesbag 1.0, a sales presentation tool geared at the financial services industry. The project represents somewhat of departure for Mindgrub as a consultancy. Most previous projects have been a once-and-done kind of project. For Salesbag we&#8217;ll be working long-term with Wheelhouse to release frequent updates to the app. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zearfoss.wordpress.com&amp;blog=20463411&amp;post=307&amp;subd=zearfoss&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This month <a title="Mindgrub Technologies" href="http://www.mindgrub.com">Mindgrub</a> and <a title="Wheelhouse Analytics" href="http://www.wheelhouseanalytics.com/">Wheelhouse Analytics</a> released <a title="Salesbag on the app store" href="http://itunes.apple.com/us/app/salesbag/id459462562?mt=8&amp;ls=1">Salesbag 1.0</a>, a sales presentation tool geared at the financial services industry. The project represents somewhat of departure for Mindgrub as a consultancy. Most previous projects have been a once-and-done kind of project. For Salesbag we&#8217;ll be working long-term with Wheelhouse to release frequent updates to the app.</p>
<p>This presented numerous challenges as 1.0 got out the door and we started work on the first set of updates. Aside from our internal testing team, Wheelhouse has a team of their own. They want to be able to show the app store version off while still testing our updated builds to them. To keep the development and live builds totally separate we decided the best course was to create separate target for the dev version that they would use for their testing. To iPad, these would look like entirely different apps, so we&#8217;d never run the chance of damaging the live data during testing. In the rest of this post I&#8217;ll detail how to create a separate development target for testing purposes some of the added benefits you&#8217;ll get out of doing this.</p>
<p><strong>Step 1 &#8211; Create a new app id and provisioning profile.</strong></p>
<p>In the provisioning portal, create a new app id and ad hoc provisioning portal. I assume that everyone reading knows how to do this. For Salesbag we created a com.wheelhouse.salesbagDev app id.</p>
<p><strong>Step 2 &#8211; Create a duplicate target</strong></p>
<p>Duplicating the target is simple. Simply right click the build target in the project details and select &#8220;duplicate&#8221;.</p>
<p><a href="http://zearfoss.files.wordpress.com/2011/12/dupe-target.png"><img class="alignnone size-medium wp-image-314" title="dupe target" src="http://zearfoss.files.wordpress.com/2011/12/dupe-target.png?w=300&#038;h=133" alt="" width="300" height="133" /></a></p>
<p><strong>Step 3 &#8211; Create a duplicate info plist</strong></p>
<p>In order to use the new app id, we&#8217;ll need to duplicate and modify the info.plist to include the new app id.</p>
<p><a href="http://zearfoss.files.wordpress.com/2011/12/dupe-plist.png"><img class="alignnone size-medium wp-image-313" title="dupe plist" src="http://zearfoss.files.wordpress.com/2011/12/dupe-plist.png?w=300&#038;h=300" alt="" width="300" height="300" /></a></p>
<p>You can also change other build settings like the bundle display name to make your dev version distinguishable from the production app.</p>
<p><strong>Step 4 &#8211; Modify the target build settings to include the new plist</strong></p>
<p>The new target must know to use the new the info.plist. Open the build settings for the target, search for info, and change the name of the info.plist.</p>
<p><a href="http://zearfoss.files.wordpress.com/2011/12/change-plist.png"><img class="alignnone size-medium wp-image-312" title="change plist" src="http://zearfoss.files.wordpress.com/2011/12/change-plist.png?w=300&#038;h=123" alt="" width="300" height="123" /></a></p>
<p><strong>Step 5 &#8211; Create a new scheme to build the new target</strong></p>
<p>The last thing to do is to create a new scheme to build the new target. Under the schemes drop down at the top of the Xcode window and select manage schemes to bring up the scheme manager. You select duplicate from the actions (gear) menu at the bottom of the window.</p>
<p><a href="http://zearfoss.files.wordpress.com/2011/12/dupe-scheme.png"><img class="alignnone size-medium wp-image-311" title="dupe scheme" src="http://zearfoss.files.wordpress.com/2011/12/dupe-scheme.png?w=300&#038;h=234" alt="" width="300" height="234" /></a></p>
<p>Once your new scheme is created, click edit to open the new scheme. All you need to do next is replace the old target with your dev target and hit ok (this is in the &#8220;build&#8221; section).</p>
<p><a href="http://zearfoss.files.wordpress.com/2011/12/edit-target.png"><img class="alignnone size-medium wp-image-310" title="edit target" src="http://zearfoss.files.wordpress.com/2011/12/edit-target.png?w=300&#038;h=204" alt="" width="300" height="204" /></a></p>
<p>You should now see the new scheme in the schemes drop down.</p>
<p><a href="http://zearfoss.files.wordpress.com/2011/12/new-scheme.png"><img class="alignnone size-medium wp-image-309" title="new scheme" src="http://zearfoss.files.wordpress.com/2011/12/new-scheme.png?w=300&#038;h=122" alt="" width="300" height="122" /></a></p>
<p><strong>BONUS &#8211; Setup target specific code</strong></p>
<p>In the dev version of salesbag we added some features for testers to be able to wipe out old data from previous iterations of Salesbag (in our case local eventkit calendars from development on the earlier versions). With your new target you can easily create custom preprocessor directives to dynamically include code in dev versions that you give to your testers.</p>
<p><strong>Step 1 &#8211; Create a new preprocessor macro</strong></p>
<p>In the build settings for the dev target search for preprocessor and double click the section called Preprocessor Macros under the target. Add a new parameter in here. We chose &#8220;DEV_VERSION=1&#8243;.</p>
<p><a href="http://zearfoss.files.wordpress.com/2011/12/macro.png"><img class="alignnone size-medium wp-image-308" title="macro" src="http://zearfoss.files.wordpress.com/2011/12/macro.png?w=300&#038;h=57" alt="" width="300" height="57" /></a></p>
<p><strong>Step 2 &#8211; Use your new macro in code</strong></p>
<p>To include code specifically for your dev version, simply use the macro you created in step 1:</p>
<p><pre class="brush: objc;">
#if DEV_VERSION
NSLog(@&quot;cool testing feature&quot;);
#endif
</pre></p>
<p><strong>That&#8217;s it</strong>!</p>
<p>Hopefully the process above will help some other developers in their longer term projects.  Also be sure to drop a comment if you have any feedback.  Happy coding!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zearfoss.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zearfoss.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zearfoss.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zearfoss.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zearfoss.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zearfoss.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zearfoss.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zearfoss.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zearfoss.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zearfoss.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zearfoss.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zearfoss.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zearfoss.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zearfoss.wordpress.com/307/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zearfoss.wordpress.com&amp;blog=20463411&amp;post=307&amp;subd=zearfoss&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zearfoss.wordpress.com/2011/12/23/multiple-build-targets-for-fun-and-profit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/db4f7b370eadc859c1c32d417ce0b541?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pzearfoss</media:title>
		</media:content>

		<media:content url="http://zearfoss.files.wordpress.com/2011/12/dupe-target.png?w=300" medium="image">
			<media:title type="html">dupe target</media:title>
		</media:content>

		<media:content url="http://zearfoss.files.wordpress.com/2011/12/dupe-plist.png?w=300" medium="image">
			<media:title type="html">dupe plist</media:title>
		</media:content>

		<media:content url="http://zearfoss.files.wordpress.com/2011/12/change-plist.png?w=300" medium="image">
			<media:title type="html">change plist</media:title>
		</media:content>

		<media:content url="http://zearfoss.files.wordpress.com/2011/12/dupe-scheme.png?w=300" medium="image">
			<media:title type="html">dupe scheme</media:title>
		</media:content>

		<media:content url="http://zearfoss.files.wordpress.com/2011/12/edit-target.png?w=300" medium="image">
			<media:title type="html">edit target</media:title>
		</media:content>

		<media:content url="http://zearfoss.files.wordpress.com/2011/12/new-scheme.png?w=300" medium="image">
			<media:title type="html">new scheme</media:title>
		</media:content>

		<media:content url="http://zearfoss.files.wordpress.com/2011/12/macro.png?w=300" medium="image">
			<media:title type="html">macro</media:title>
		</media:content>
	</item>
		<item>
		<title>This? You just need to watch this.</title>
		<link>http://zearfoss.wordpress.com/2011/12/11/this-you-just-need-to-watch-this/</link>
		<comments>http://zearfoss.wordpress.com/2011/12/11/this-you-just-need-to-watch-this/#comments</comments>
		<pubDate>Sun, 11 Dec 2011 05:25:56 +0000</pubDate>
		<dc:creator>pzearfoss</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Methods]]></category>
		<category><![CDATA[Other]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[business of software]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[estimation]]></category>

		<guid isPermaLink="false">http://zearfoss.wordpress.com/?p=305</guid>
		<description><![CDATA[Greg Wilson &#8211; What We Actually Know About Software Development, and Why We Believe It&#8217;s True from CUSEC on Vimeo.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zearfoss.wordpress.com&amp;blog=20463411&amp;post=305&amp;subd=zearfoss&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><div class='embed-vimeo' style='text-align:center;'><iframe src='http://player.vimeo.com/video/9270320' width='400' height='225' frameborder='0'></iframe></div>
<p><a href="http://vimeo.com/9270320">Greg Wilson &#8211; What We Actually Know About Software Development, and Why We Believe It&#8217;s True</a> from <a href="http://vimeo.com/cusec">CUSEC</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zearfoss.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zearfoss.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zearfoss.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zearfoss.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zearfoss.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zearfoss.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zearfoss.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zearfoss.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zearfoss.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zearfoss.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zearfoss.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zearfoss.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zearfoss.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zearfoss.wordpress.com/305/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zearfoss.wordpress.com&amp;blog=20463411&amp;post=305&amp;subd=zearfoss&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zearfoss.wordpress.com/2011/12/11/this-you-just-need-to-watch-this/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/db4f7b370eadc859c1c32d417ce0b541?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pzearfoss</media:title>
		</media:content>
	</item>
		<item>
		<title>A Cool KVO Trick</title>
		<link>http://zearfoss.wordpress.com/2011/11/29/a-cool-kvo-trick/</link>
		<comments>http://zearfoss.wordpress.com/2011/11/29/a-cool-kvo-trick/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 15:31:25 +0000</pubDate>
		<dc:creator>pzearfoss</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[KVO]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[observiing]]></category>

		<guid isPermaLink="false">http://zearfoss.wordpress.com/?p=300</guid>
		<description><![CDATA[A coworker of mine attended the Voices that Matter conference in Boston a couple of weeks ago and shared this idea about KVO observing from Mike Ash during his Defensive Programming talk.  He suggests supplying a static pointer to the context parameter: Seems like a lot of magic at first, but by specifying a context [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zearfoss.wordpress.com&amp;blog=20463411&amp;post=300&amp;subd=zearfoss&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A coworker of mine attended the Voices that Matter conference in Boston a couple of weeks ago and shared this idea about KVO observing from <a href="http://www.mikeash.com/pyblog/">Mike Ash</a> during his <a href="http://ios2011.voicesthatmatter.com/talks/20553">Defensive Programming</a> talk.  He suggests supplying a static pointer to the context parameter:</p>
<p><pre class="brush: objc;">

static void *p = &amp;p;

[someObj addObserver:self forKeyPath:@&quot;aPath&quot; options:NSKeyValueObservingOptionNew context:p];

// ...

- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
    if (context == p)
    {
        // do stuff
    }
    else
    {
        [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
    }
}
</pre></p>
<p>Seems like a lot of magic at first, but by specifying a context every time and using one that&#8217;s not only unique to your object but also to the file containing your subclass you can ensure that the message sent to you is actually for you and you avoid potentially stepping on the toes of your super class. Neat stuff!  It&#8217;s also worth noting that checking the context pointer first is a super-fast way to see if you need to care about the observation method.</p>
<p><strong>Side note:</strong> if you&#8217;re not subscribed to Mike Ash&#8217;s Friday Q&amp;A blog (link above), you definitely should. I learn something new there every week.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zearfoss.wordpress.com/300/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zearfoss.wordpress.com/300/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zearfoss.wordpress.com/300/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zearfoss.wordpress.com/300/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zearfoss.wordpress.com/300/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zearfoss.wordpress.com/300/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zearfoss.wordpress.com/300/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zearfoss.wordpress.com/300/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zearfoss.wordpress.com/300/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zearfoss.wordpress.com/300/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zearfoss.wordpress.com/300/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zearfoss.wordpress.com/300/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zearfoss.wordpress.com/300/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zearfoss.wordpress.com/300/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zearfoss.wordpress.com&amp;blog=20463411&amp;post=300&amp;subd=zearfoss&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zearfoss.wordpress.com/2011/11/29/a-cool-kvo-trick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/db4f7b370eadc859c1c32d417ce0b541?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pzearfoss</media:title>
		</media:content>
	</item>
		<item>
		<title>Cappuccino : First Thoughts</title>
		<link>http://zearfoss.wordpress.com/2011/11/25/cappuccino-first-thoughts/</link>
		<comments>http://zearfoss.wordpress.com/2011/11/25/cappuccino-first-thoughts/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 14:22:51 +0000</pubDate>
		<dc:creator>pzearfoss</dc:creator>
				<category><![CDATA[Cappuccino]]></category>
		<category><![CDATA[idevblogaday]]></category>

		<guid isPermaLink="false">http://zearfoss.wordpress.com/?p=293</guid>
		<description><![CDATA[Hello to all the readers coming from iDevBlogADay!  I&#8217;ve started working on a project that is being built using Cappuccino, a web development framework modeled off Objective-c and Cocoa.  After working with it for about 5 days I wanted to scribble down my first impression of the framework and tools. Language: The language for working [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zearfoss.wordpress.com&amp;blog=20463411&amp;post=293&amp;subd=zearfoss&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello to all the readers coming from iDevBlogADay!  I&#8217;ve started working on a project that is being built using <a title="Onward to Objective-J" href="http://www.cappuccino.org">Cappuccino</a>, a web development framework modeled off Objective-c and Cocoa.  After working with it for about 5 days I wanted to scribble down my first impression of the framework and tools.</p>
<p><strong>Language:</strong></p>
<p>The language for working with Cappuccino is objective-j.  Objective-j is to javascript what objective-c is to c in that you get object orientedness without it mucking up the foundations of the base language.  <a href="http://cappuccino.org/discuss/2008/12/08/on-leaky-abstractions-and-objective-j/">According to its creators</a>, this is exactly why they chose the smalltalk style syntax of objective-c over other constructs when deciding how to craft their language.</p>
<p>Coming from iOS development, picking up the syntax was a breeze.  Having had a background with javascript didn&#8217;t hurt either, but I haven&#8217;t yet run across any particular problem where I&#8217;ve had to lean on that knowledge to move forward.  Some things are different though and might trip up would be adopters:</p>
<ol>
<li><strong>No .h files</strong> &#8211; Javascript has no notion of separate compilation (or compilation at all for that matter).  As a result there is no .h file, only your .j which contains your @implementation block.  The @implementation block serves as both the @interface and @implementation from objective-c containing instance variables and full method implementations.</li>
<li><strong>No properties</strong> &#8211; I know there&#8217;s some haters of the @property directive in the community.  To those folks, I don&#8217;t know how you ever lived without dot syntax, as it&#8217;s the one thing I miss from objective-c.  Typing things like [[[self view] subviews] objectAtIndex:0] and the like gets a bit tedious after a while.  That said, you can still have objective-j generate accessors for you with the @accessors directive.    Why the lack of dot syntax?  For the same reason objective-j was chosen: not breaking javascript.  Javascript <em>is </em>object oriented in its own way, so supplanting its existing dot syntax would break the language.</li>
<li><strong>Variable naming</strong> &#8211; iVars in the interface are still named with their type, but without the &#8216;*&#8217; or pointer to it.  Local variables cannot be typed (probably what still trips me up the most).  The keyword for a local variable is &#8220;var&#8221; from javascript syntax.  All this really means is that you need to be extra careful naming variables so you know what they are later in code.</li>
</ol>
<p><strong>Frameworks:</strong></p>
<p>I can&#8217;t help but be impressed with how thorough the Cappuccino folks have been in duplicating the Cocoa frameworks.  Virtually all the foundation classes you might need are there as well as much of the Cocoa UI components.  This is probably the greatest benefit to using Cappuccino is the sheer number of controls available out of the box without having to get into the nitty gritty of HTML and CSS manipulation required to get things like scrolling table view and outline views.  Cappuccino keeps the API to very close to their Cocoa counterparts so using them is easy if you&#8217;re already familiar.</p>
<p><strong>Installing:</strong></p>
<p>To get started learning Cappuccino provides a starter package that let&#8217;s you play around with the frameworks.  For a full fledged installation, the simplest thing is to build the frameworks from source.  There&#8217;s an installation script that will download the sources and compile them.  The included jake tool (think make, but for javascript) makes it very simple to build all the frameworks you need and deploy your application later.  All this work is done on the command line, so you&#8217;ll want to be comfortable in terminal before you dive in.</p>
<p><strong>Development Tools:</strong></p>
<p>This is probably where Cappuccino is lacking the most at the moment.  There is an Xcode plugin but I&#8217;ve found it&#8217;s crashy and unreliable in Xcode 4.  So far the best set of tools I can find are TextMate and Xcode&#8217;s Interface Builder with XCodeCapp which converts the xib files to cib (Cappuccino interface files) on the fly.  Coda has support for objective-j though I haven&#8217;t tried it out yet.</p>
<p>Debugging has its own set of challenges as well.  It&#8217;s supposedly possible to set breakpoints in either firebug or safari&#8217;s web developer window, but I haven&#8217;t seen how to do that yet.  So far console.log has been my best friend for debugging my application.  Additionally, since there is no compiler you don&#8217;t get the benefit of compiler errors and warnings to help you along.</p>
<p>I&#8217;m hoping the state of the tools improves as Cappuccino chugs closer to 1.0.  I&#8217;d love to see a full blown Xcode plugin with code completion, debugging, and building and deployment.  That is a tall order of course, especially when Xcode itself sometimes feels more like a beta than a fully tested application.  280North, the team behind Cappuccino seemed to have something strong going with Atlas, a web based interface builder and IDE, but there hasn&#8217;t been any movement on that since they were bought out by Motorola a couple of years ago.</p>
<p><strong>Results</strong>:</p>
<p>Tools aside, the amount you&#8217;re able to produce with very little code (especially if using interface builder) is pretty profound.  Having worked on web applications in the past it&#8217;s refreshing to be able to focus on the logic of the app rather than being worried about the ins and outs of HTML, CSS, and raw javascript.  Cappuccino seems to make intelligent decisions about how rendering a given view should be handled, whether with a div or HTML 5 canvas.  Having a proper abstraction for the DOM is invaluable in this regard and most of the default controls look great right out of the box.</p>
<p><strong>Conclusion:</strong></p>
<p>If nothing else it&#8217;s fantastic to be able to use my objective-c skill set and jump into developing a modern web application quickly using cappuccino.  It requires you to develop your own workflow; it&#8217;s not as integrated as iOS / Xcode is.  The tools, however, seem to be improving as the Cappuccino approaches 1.0.  In all, I left web development because I didn&#8217;t like having to deal with both the application logic and HTML/css drudgery simultaneously to get anything done.  Cappuccino solves that problem for me and has allowed to me to produce some promising stuff very quickly.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zearfoss.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zearfoss.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zearfoss.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zearfoss.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zearfoss.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zearfoss.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zearfoss.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zearfoss.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zearfoss.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zearfoss.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zearfoss.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zearfoss.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zearfoss.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zearfoss.wordpress.com/293/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zearfoss.wordpress.com&amp;blog=20463411&amp;post=293&amp;subd=zearfoss&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zearfoss.wordpress.com/2011/11/25/cappuccino-first-thoughts/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/db4f7b370eadc859c1c32d417ce0b541?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pzearfoss</media:title>
		</media:content>
	</item>
		<item>
		<title>Onward to Objective-J</title>
		<link>http://zearfoss.wordpress.com/2011/11/18/onward-to-objective-j/</link>
		<comments>http://zearfoss.wordpress.com/2011/11/18/onward-to-objective-j/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 01:40:24 +0000</pubDate>
		<dc:creator>pzearfoss</dc:creator>
				<category><![CDATA[Cappuccino]]></category>
		<category><![CDATA[cappuccino]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[objective-j]]></category>

		<guid isPermaLink="false">http://zearfoss.wordpress.com/?p=287</guid>
		<description><![CDATA[I&#8217;ve starting working on a web project that will be built around objective-j and cappuccino, a an objective-c/cocoa style layer above Javascript. There&#8217;s some interesting challenges to go along with it, especially as it&#8217;s a new platform and I&#8217;m relatively unfamiliar UIKit&#8217;s older brother, AppKit. I&#8217;ll be posting a lot of about it in the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zearfoss.wordpress.com&amp;blog=20463411&amp;post=287&amp;subd=zearfoss&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve starting working on a web project that will be built around objective-j and cappuccino, a an objective-c/cocoa style layer above Javascript.  There&#8217;s some interesting challenges to go along with it, especially as it&#8217;s a new platform and I&#8217;m relatively unfamiliar UIKit&#8217;s older brother, AppKit.  I&#8217;ll be posting a lot of about it in the next couple weeks as this project rolls on.  </p>
<p>As a new platform, (good) documentation is pretty scant.  Here&#8217;s a couple of links where you can learn more and get started.</p>
<p><a href="http://www.cappuccino.org" title="Cappuccino Homepage">Cappuccino Homepage</a><br />
<a href="https://github.com/280North/Cappuccino" title="280North on Github">Github repo</a> (don&#8217;t follow these install instructions, they didn&#8217;t really work for me).<br />
<a href="http://capptutorials.net/getting-started" title="Capptutorials getting started">THE tutorial that actually helped me get it installed.</a></p>
<p>Much of the install process requires you be at least pretty comfortable on the command line.  Additionally you&#8217;ll want to create .bash_profile file in your home directory if you don&#8217;t already have one since there are a couple environment variables the installer will want to create.  Overall the framework looks like it&#8217;s pretty simple to get rolling for someone like me who&#8217;s used Javascript in the past but has spent the past couple years in objective-c.  Lot&#8217;s more to come!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zearfoss.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zearfoss.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zearfoss.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zearfoss.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zearfoss.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zearfoss.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zearfoss.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zearfoss.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zearfoss.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zearfoss.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zearfoss.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zearfoss.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zearfoss.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zearfoss.wordpress.com/287/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zearfoss.wordpress.com&amp;blog=20463411&amp;post=287&amp;subd=zearfoss&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zearfoss.wordpress.com/2011/11/18/onward-to-objective-j/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/db4f7b370eadc859c1c32d417ce0b541?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pzearfoss</media:title>
		</media:content>
	</item>
	</channel>
</rss>
