<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>petersteinberger.com &#187; ObjectiveC</title>
	<atom:link href="http://petersteinberger.com/category/coding/objectivec/feed/" rel="self" type="application/rss+xml" />
	<link>http://petersteinberger.com</link>
	<description>bits about life, coding and stuff</description>
	<lastBuildDate>Fri, 13 Jan 2012 16:32:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Use Xcode+git to automatically version your apps</title>
		<link>http://petersteinberger.com/2011/12/use-xcodegit-to-automatically-version-your-apps/</link>
		<comments>http://petersteinberger.com/2011/12/use-xcodegit-to-automatically-version-your-apps/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 15:21:36 +0000</pubDate>
		<dc:creator>studpete</dc:creator>
				<category><![CDATA[ObjectiveC]]></category>

		<guid isPermaLink="false">http://petersteinberger.com/?p=1194</guid>
		<description><![CDATA[It&#8217;s convenient to use git&#8217;s commit hash as a versioning tool. Here&#8217;s an easy way to integrate this with Xcode. Bonus: This one doesn&#8217;t actually change the Info.plist file, so after a compile there are no dirty files git would want to check in. The first method works for regular apps. At the end I show a [...]
Related posts:<ol>
<li><a href='http://petersteinberger.com/2009/04/xcode-opens-windows-off-screen/' rel='bookmark' title='XCode opens windows off-screen?'>XCode opens windows off-screen?</a></li>
<li><a href='http://petersteinberger.com/2009/07/add-a-version-timestamp-with-capistrano/' rel='bookmark' title='Add a version timestamp with capistrano'>Add a version timestamp with capistrano</a></li>
<li><a href='http://petersteinberger.com/2009/10/enable-clang-in-xcode/' rel='bookmark' title='Enable Clang in XCode'>Enable Clang in XCode</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s convenient to use git&#8217;s commit hash as a versioning tool. Here&#8217;s an easy way to integrate this with Xcode.<br />
Bonus: This one doesn&#8217;t actually change the Info.plist file, so after a compile there are no dirty files git would want to check in.</p>
<p>The first method works for regular apps. At the end I show a option if you&#8217;re building a framework/static library.</p>
<p>Easiest way: Use the Info.plist preprocessor. Add this as a Run Script phase at the top of your target (after Target Dependencies).<br />
<script src="https://gist.github.com/1501754.js?file=gistfile1.sh"></script><br />
We&#8217;re using the output of git describe as the full version string (which can be anything, according to Apple), and the count of the total commits for CFBundleVersion, which should be numeric, else certain functions like Finder&#8217;s ability to find the lastest app version might break. Counting git commits is not the best way, but it works.</p>
<p>Then, enable &#8220;Preprocess Info.plist File&#8221; and add &#8220;Info.plist Preprocessor Prefix File&#8221; to &#8220;InfoPlist.h&#8221;.<br />
<img class="alignnone size-full wp-image-1196" title="InfoPlistSettings" src="http://petersteinberger.com/wp-content/uploads/2011/12/InfoPlistSettings.png" alt="" width="797" height="106" /></p>
<p>Almost done! Add GIT_VERSION and GIT_COMMIT_COUNT to your Info.plist file:</p>
<p><script src="https://gist.github.com/1501859.js?file=gistfile1.xml"></script></p>
<p>Finally, you need to create the InfoPlist.h file once, else Xcode doesn&#8217;t compile at all.<br />
<script src="https://gist.github.com/1501869.js?file=gistfile1.sh"></script></p>
<p>That&#8217;s it! Note that you probably don&#8217;t want to use &#8220;1.x.x-00-g34g3343&#8243; as a version for the AppStore. In this case, make a target for publishing and change the git describe to &#8220;git describe &#8211;abbrev=0 &#8211;tags&#8221; (this will return the latest tag &#8211; you DO tag your code, right?)</p>
<p>If you are doing more tricky things, like compiling your own static framework (I provide one for <a href="http://pspdfkit.com" target="_blank" class="liexternal">PSPDFKit</a>), you need stronger weapons. Add this to your build script. No need for custom Info.plist preprocessing in this case. (I manually copy Info.plist into the directory, so the original plist file never gets changed.)</p>
<p><script src="https://gist.github.com/1501874.js?file=gistfile1.sh"></script></p>
<p>Thanks for everyone on Twitter helping me to get this right! This <a href="http://www.cimgf.com/2011/02/20/revisiting-git-tags-and-building/" target="_blank" class="liexternal">blog post on CIMGF</a> was also pretty helpful.</p>
<p>Of you like posts like this, <a href="http://twitter.com/steipete" target="_blank" class="liexternal">you should follow me on Twitter</a>.</p>
<p>Related posts:<ol>
<li><a href='http://petersteinberger.com/2009/04/xcode-opens-windows-off-screen/' rel='bookmark' title='XCode opens windows off-screen?'>XCode opens windows off-screen?</a></li>
<li><a href='http://petersteinberger.com/2009/07/add-a-version-timestamp-with-capistrano/' rel='bookmark' title='Add a version timestamp with capistrano'>Add a version timestamp with capistrano</a></li>
<li><a href='http://petersteinberger.com/2009/10/enable-clang-in-xcode/' rel='bookmark' title='Enable Clang in XCode'>Enable Clang in XCode</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://petersteinberger.com/2011/12/use-xcodegit-to-automatically-version-your-apps/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fast and elegant delegation in Objective-C</title>
		<link>http://petersteinberger.com/2011/09/fast-and-elegant-delegation-in-objective-c/</link>
		<comments>http://petersteinberger.com/2011/09/fast-and-elegant-delegation-in-objective-c/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 16:07:15 +0000</pubDate>
		<dc:creator>studpete</dc:creator>
				<category><![CDATA[ObjectiveC]]></category>

		<guid isPermaLink="false">http://petersteinberger.com/?p=1180</guid>
		<description><![CDATA[If you call an optional delegate protocol, and it grows larger and larger, you find yourself write variations of this ugly block all over your code: [cc lang="objc"] if ([self.delegate respondsToSelector:@selector(pdfViewController:didDisplayDocument:)]) { [self.delegate pdfViewController:self didDisplayDocument:self.document]; } [/cc] I consider this code smell, and it doesn&#8217;t get easier once you decide to change the delegate. While [...]
Related posts:<ol>
<li><a href='http://petersteinberger.com/2009/10/objective-c-operator-overloading/' rel='bookmark' title='Objective C != Operator overloading'>Objective C != Operator overloading</a></li>
<li><a href='http://petersteinberger.com/2009/11/detect-conflicting-objective-c-category-methods/' rel='bookmark' title='Detect conflicting Objective C category methods'>Detect conflicting Objective C category methods</a></li>
<li><a href='http://petersteinberger.com/2009/10/objective-c-blocks-with-leopard-10-5-and-iphone-3-0/' rel='bookmark' title='Objective C Blocks with Leopard 10.5 and iPhone 3.0'>Objective C Blocks with Leopard 10.5 and iPhone 3.0</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>If you call an optional delegate protocol, and it grows larger and larger, you find yourself write variations of this ugly block all over your code:</p>
<p>[cc lang="objc"]<br />
if ([self.delegate respondsToSelector:@selector(pdfViewController:didDisplayDocument:)]) {<br />
[self.delegate pdfViewController:self didDisplayDocument:self.document];<br />
}<br />
[/cc]</p>
<p>I consider this code smell, and it doesn&#8217;t get easier once you decide to change the delegate. While developing <a href="http://pspdfkit.com" target="_blank" class="liexternal">PSPDFKit</a> (a commercial, extremely fast iOS pdf framework), i found myself in the situation of polluting my code with those delegate calls all over the place. There has to be a better way.</p>
<p>During my Twitter research, I fond some experiments like <a href="http://borkware.com/rants/agentm/elegant-delegation/" target="_blank" class="liexternal">using an NSProxy</a> or <a href="http://www.dribin.org/dave/blog/archives/2007/01/18/objc_delegate_optimization/" target="_blank" class="liexternal">using _cmd as a shortcut</a>. Using _cmd would imply that you name your delegate caller the same as your delegate method. THATS A VERY, VERY BAD IDEA. It&#8217;s often practical to extend a class and set the delegate to itself &#8211; in fact that&#8217;s <a href="https://github.com/steipete/PSPDFKit-Demo/blob/master/Examples/PSPDFKitExample/PSPDFExampleViewController.m" target="_blank" class="liexternal">the suggested way to customize PSPDFViewController</a>. Using the _cmd trick would imply that the user calls [super ---] on every delegate &#8211; forgetting that would work most times, except when he tries to nil out the delegate on viewWillDisappear, and still receive messages (because there is no caller any more) &#8211; leading to very confusing errors.</p>
<p>A pattern that&#8217;s common in Apple classes is to pre-analyze the delegate, and remember which methods are implemented and which aren&#8217;t. I did some profiling and discovered that <strong>this is about twice as fast</strong>. In reality, you may not care, delegates usually are not called in tight loops, where you could actually gain some <em>feelable</em> performance with this task.</p>
<p>But we gain something else: clarity. Here&#8217;s my proposal:</p>
<p>[cc lang="objc" lines="100"]<br />
// pre-process delegate<br />
- (void)setDelegate:(id)delegate {<br />
if (delegate != delegate_) {<br />
delegate_ = delegate;</p>
<p>delegateFlags_.delegateDidDisplayDocument = [delegate respondsToSelector:@selector(pdfViewController:didDisplayDocument:)];<br />
delegateFlags_.delegateDidShowPage = [delegate respondsToSelector:@selector(pdfViewController:didShowPage:)];<br />
}<br />
}</p>
<p>// single entry point to call delegate<br />
- (void)delegateDidShowPage:(NSUInteger)page {<br />
if (delegateFlags_.delegateDidShowPage) {<br />
[self.delegate pdfViewController:self didShowPage:page];<br />
}</p>
<p>// put this in header<br />
struct {<br />
unsigned int delegateWillDisplayDocument:1;<br />
unsigned int delegateDidDisplayDocument:1;<br />
unsigned int delegateWillShowPage:1;<br />
unsigned int delegateDidShowPage:1;<br />
unsigned int delegateDidChangeViewMode:1;<br />
unsigned int delegateDidTapOnPage:1;<br />
unsigned int delegateDidTapOnAnnotation:1;<br />
unsigned int delegateWillLoadPage:1;<br />
unsigned int delegateDidLoadPage:1;<br />
unsigned int delegateWillUnloadPage:1;<br />
unsigned int delegateDidUnloadPage:1;<br />
} delegateFlags_;</p>
<p>[/cc]</p>
<p>So, this is much more code, what&#8217;s better?</p>
<ul>
<li>Instantly see which methods are implemented by the delegate.</li>
<li>Calling [self delegateDidShowPage:1]; instead of the 3-line respondsToSelector improves code readability.</li>
<li>Single calling function for delegates. Again, helps for debugging.</li>
<li>Delegates can be changed much easier.</li>
<li>Twice as fast!</li>
</ul>
<p><strong>Bonus feature:</strong> Because there&#8217;s now a single entry point, it&#8217;s easy to add a one-time deprecation warning (like an NSLog) to the delegate caller. That would be a PITA if you have multiple entry points.</p>
<p>I also experimented with further improvements, and you can squeeze out even more performance by using c-functions, and again more if you inline them. But it&#8217;s usually not worth it and the calling syntax doesn&#8217;t look nice.</p>
<p>Btw, I used <a href="http://stackoverflow.com/questions/1615998/rudimentary-ways-to-measure-execution-time-of-a-method" target="_blank" class="liexternal">mach_absolut_time</a> to measure execution time. Don&#8217;t use NSDate for it, it&#8217;s too unprecise. (Some technical stuff: I used a tight 1-million for-loop to get some milliseconds to measure, and disabled optimization so that the if couldn&#8217;t be pre-optimized)</p>
<p>I&#8217;m open to comments. Is there a better way? Waste of time? Hit me up on Twitter! <a href="http://twitter.com/steipete" target="_blank" class="liexternal">@steipete</a></p>
<p>Related posts:<ol>
<li><a href='http://petersteinberger.com/2009/10/objective-c-operator-overloading/' rel='bookmark' title='Objective C != Operator overloading'>Objective C != Operator overloading</a></li>
<li><a href='http://petersteinberger.com/2009/11/detect-conflicting-objective-c-category-methods/' rel='bookmark' title='Detect conflicting Objective C category methods'>Detect conflicting Objective C category methods</a></li>
<li><a href='http://petersteinberger.com/2009/10/objective-c-blocks-with-leopard-10-5-and-iphone-3-0/' rel='bookmark' title='Objective C Blocks with Leopard 10.5 and iPhone 3.0'>Objective C Blocks with Leopard 10.5 and iPhone 3.0</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://petersteinberger.com/2011/09/fast-and-elegant-delegation-in-objective-c/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Hacking on Chameleon</title>
		<link>http://petersteinberger.com/2011/03/hacking-on-chameleon/</link>
		<comments>http://petersteinberger.com/2011/03/hacking-on-chameleon/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 16:14:56 +0000</pubDate>
		<dc:creator>studpete</dc:creator>
				<category><![CDATA[ObjectiveC]]></category>

		<guid isPermaLink="false">http://petersteinberger.com/?p=1176</guid>
		<description><![CDATA[Chameleon is a clean-room implementation of UIKit. So you can just compile your iOS App to the mac. And boy are there some iOS apps out there that I want on my mac (even better: on the dashboard!) Currently it&#8217;s about 70% complete, and simple projects already compile. And the pull requests are already underway. [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p><a href="http://chameleonproject.org/" target="_blank" class="liexternal">Chameleon</a> is a clean-room implementation of UIKit. So you can just compile your iOS App to the mac. And boy are there some iOS apps out there that I want on my mac (even better: on the dashboard!)</p>
<p>Currently it&#8217;s about 70% complete, and simple projects already compile. And the <a href="https://github.com/BigZaphod/Chameleon/pull/7" target="_blank" class="liexternal">pull requests</a> are already underway.<br />
And because it&#8217;s from a <a href="http://iconfactory.com/software/twitterrific" target="_blank" class="liexternal">working, living, money generating project</a>, it won&#8217;t vanish anytime soon. Thank you, Iconfactory!</p>
<p>I added some initial helper macros for the parts for better code conditionals in <a href="https://github.com/steipete/PSFoundation" target="_blank" class="liexternal">PSFoundation</a> (Categories, Macros and other useful stuff) And fixed the parts that don&#8217;t compile at all. This is going to be great!</p>
<p>The hardest part will be coding a replacement for NSFetchedResultsController; I started a stub w/o event handling&#8230;</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://petersteinberger.com/2011/03/hacking-on-chameleon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Presenting a better Template for iOS Apps: PSiOSAppTemplate</title>
		<link>http://petersteinberger.com/2010/12/presenting-a-better-template-for-ios-apps-psiosapptemplate/</link>
		<comments>http://petersteinberger.com/2010/12/presenting-a-better-template-for-ios-apps-psiosapptemplate/#comments</comments>
		<pubDate>Sun, 12 Dec 2010 17:41:37 +0000</pubDate>
		<dc:creator>studpete</dc:creator>
				<category><![CDATA[ObjectiveC]]></category>

		<guid isPermaLink="false">http://petersteinberger.com/?p=1128</guid>
		<description><![CDATA[As a christmas present to everyone, i&#8217;m opening my toolbox and open source my iOS App Template. JSON-Parsing, AutoUpdating, CrashReporter+Sender, Statistics, custom Logging, Localization&#8230; all those little things already set up, ready for you to make awesome stuff! Running it is rather unspectacular, all you see is a shadowed UITableView. It&#8217;s the libraries that are awesome; [...]
Related posts:<ol>
<li><a href='http://petersteinberger.com/2011/12/use-xcodegit-to-automatically-version-your-apps/' rel='bookmark' title='Use Xcode+git to automatically version your apps'>Use Xcode+git to automatically version your apps</a></li>
<li><a href='http://petersteinberger.com/2010/12/synbolicatecrash-troubles/' rel='bookmark' title='synbolicatecrash troubles?'>synbolicatecrash troubles?</a></li>
<li><a href='http://petersteinberger.com/2010/09/cocoaheads-presentation-hockey-lumberjack/' rel='bookmark' title='Cocoaheads Presentation: Hockey &amp; Lumberjack'>Cocoaheads Presentation: Hockey &#038; Lumberjack</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>As a christmas present to everyone, i&#8217;m opening <a href="https://github.com/steipete/PSFoundation" target="_blank" class="liexternal">my toolbox</a> and open source my <a href="https://github.com/steipete/PSiOSAppTemplate" target="_blank" class="liexternal">iOS App Template</a>. JSON-Parsing, AutoUpdating, CrashReporter+Sender, Statistics, custom Logging, Localization&#8230; all those little things already set up, ready for you to make awesome stuff!</p>
<p>Running it is rather unspectacular, all you see is a shadowed UITableView. It&#8217;s the libraries that are awesome; and for many of you there&#8217;ll be some new things to discover. It&#8217;s really useful as a kickstart for new apps. Feel free to fork and make changes; just contact me for what you use it.</p>
<p><strong>Whats in the box?</strong></p>
<ul>
<li>Localization for English/German pre-setup</li>
<li>Xcode agnostic gitignore setup</li>
<li>Completely setup autoupdating via Hockey, with custom Target for instant App-Distribution. All you need is to modify the ssh script in the BetaDistribute target and setup a server with the Hockey server parts: https://github.com/TheRealKerni/Hockey</li>
<li>Integrated Crash Reporter Server sender. Just activate in PSDefines and https://github.com/TheRealKerni/CrashReporterDemo</li>
<li>Adapted symbolicator for remove crash report symbolication</li>
<li>Integrated super fast and efficient YAJL JSON parser
<p>http://lloyd.github.com/yajl/</li>
<li>PSFoundation for all those little categories, reachability and co:
<p>https://github.com/steipete/PSFoundation</li>
<li>Flurry for app statistics. Just add your statistics key to kFlurryStatisticsKey
<p>http://www.flurry.com/</li>
<li>Custom logging (cocoa-lumberjack) with file logging and NSLogger integration See https://github.com/robbiehanson/CocoaLumberjack and https://github.com/fpillet/NSLogger</li>
<li>RegexKitLite
<p>http://regexkit.sourceforge.net/RegexKitLite/</li>
<li>asi-http-request for everything http-related; better alternative to NSURLConnection
<p>https://github.com/pokeb/asi-http-request</li>
</ul>
<p><a href="https://github.com/steipete/PSiOSAppTemplate" target="_blank" class="liexternal">It&#8217;s on GitHub</a>.</p>
<p>Related posts:<ol>
<li><a href='http://petersteinberger.com/2011/12/use-xcodegit-to-automatically-version-your-apps/' rel='bookmark' title='Use Xcode+git to automatically version your apps'>Use Xcode+git to automatically version your apps</a></li>
<li><a href='http://petersteinberger.com/2010/12/synbolicatecrash-troubles/' rel='bookmark' title='synbolicatecrash troubles?'>synbolicatecrash troubles?</a></li>
<li><a href='http://petersteinberger.com/2010/09/cocoaheads-presentation-hockey-lumberjack/' rel='bookmark' title='Cocoaheads Presentation: Hockey &amp; Lumberjack'>Cocoaheads Presentation: Hockey &#038; Lumberjack</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://petersteinberger.com/2010/12/presenting-a-better-template-for-ios-apps-psiosapptemplate/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>How-to find strange memory problems with szone_free, szone_malloc_should_clear</title>
		<link>http://petersteinberger.com/2010/12/how-to-find-strange-memory-problems-with-szone_free-szone_malloc_should_clear/</link>
		<comments>http://petersteinberger.com/2010/12/how-to-find-strange-memory-problems-with-szone_free-szone_malloc_should_clear/#comments</comments>
		<pubDate>Sat, 11 Dec 2010 15:10:41 +0000</pubDate>
		<dc:creator>studpete</dc:creator>
				<category><![CDATA[ObjectiveC]]></category>

		<guid isPermaLink="false">http://petersteinberger.com/?p=1115</guid>
		<description><![CDATA[For my latest iOS application, a series of really, really strange crashes bugged me. Always crashing somewhere else (I use CrashReporterDemo to get the crashes) &#8230; and never when I was using the app, but with my testers. Stacktrace crashes seemed random, most times in Apple&#8217;s classes. And ALWAYS deep within malloc. Ahh! First pointer [...]
Related posts:<ol>
<li><a href='http://petersteinberger.com/2010/09/using-gdb%e2%80%99s-%e2%80%98po%e2%80%99-command-while-a-malloc-lock-is-being-held/' rel='bookmark' title='Using GDB’s ‘po’ command while a malloc lock is being held'>Using GDB’s ‘po’ command while a malloc lock is being held</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>For my latest iOS application, a series of really, really strange crashes bugged me. Always crashing somewhere else (I use <a href="https://github.com/TheRealKerni/CrashReporterDemo" target="_blank" class="liexternal">CrashReporterDemo</a> to get the crashes) &#8230; and never when I was using the app, but with my testers. Stacktrace crashes seemed random, most times in Apple&#8217;s classes. And ALWAYS deep within malloc. Ahh! First pointer to the source. Somewhere, somehow there must be some memory corruption.</p>
<p>But wait! I&#8217;m using NSZombiesEnabled! Heck, I turned on every freakin&#8217; debug aid i found!</p>
<p><a href="http://petersteinberger.com/wp-content/uploads/2010/12/Screen-shot-2010-12-11-at-15.53.46.png" rel="lightbox[1115]" title="desperate me tried everything!" class="liimagelink"><img class="alignnone size-full wp-image-1116" title="desperate me tried everything!" src="http://petersteinberger.com/wp-content/uploads/2010/12/Screen-shot-2010-12-11-at-15.53.46.png" alt="" width="384" height="362" /></a></p>
<p>While the app ran much slower with all that stuff turned on, i found nothing. Damnit! Couldn&#8217;t even sleep right with that feakin&#8217; bug. So, we needed something bigger&#8230; and there is! Say hello to Guard Malloc! Check it with Run -&gt; Enable Guard Malloc, and start a simulator build. You better turn off all those other helpers, as it&#8217;s going to be slow, and I mean <em>really</em> slow. I had to adapt my timeouts and timers to be slow, or else even login would fail.</p>
<p>And then&#8230; nothing again. Except that you literally fall asleep while trying to use the app. Guard Malloc really tries to make memory save. (And you&#8217;d better have enough RAM for the app). So i just sitted there, waiting.</p>
<p>And finally, half an hour later, i found it. An EXC_BAD_ACCESS within dealloc of one helper class. And within that, I found the stupidest greenhorn mistake you can do. EVAR. (Maybe it&#8217;s because this actually was my first iOS app, from 2008?)</p>
<p><strong>So what the heck went wrong?</strong></p>
<p>I called [super dealloc] in dealloc before releasing my ivars with [anIvar dealloc]. And that&#8217;s <a href="http://stackoverflow.com/questions/562872/getting-a-segfault-excbadaccess-when-deallocating-variables/562885#562885" target="_blank" class="liexternal">really</a> <a href="http://stackoverflow.com/questions/909856/why-do-i-have-to-call-super-dealloc-last-and-not-first" target="_blank" class="liexternal">evil</a>. Or see the <a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html#//apple_ref/occ/instm/NSObject/dealloc" target="_blank" class="liexternal">apple docs</a>. After the NSObject dealloc (which super will somewhere down there call) our self pointer gets released. And If we are multithreaded (we are always) this memory may be already used by something else. A call like [ivar release] is automatically translated to the compiler to [self-&gt;ivar release]. So of self now is something different, we leak the old vars and release some stuff we really, really shouldn&#8217;t touch. And because malloc is highly optimized, there are no checksums or warnings that could recover from such an error, it just crashes, somewhere, somehow when trying to alloc that freed memory.</p>
<p>A one-line-fix that took he days to find. And you wonder why it didn&#8217;t crashed earlier on? Well, that helper classes&#8230; they leaked and got never released until I fixed them, thanks to clang static analysis&#8230;</p>
<p>Related posts:<ol>
<li><a href='http://petersteinberger.com/2010/09/using-gdb%e2%80%99s-%e2%80%98po%e2%80%99-command-while-a-malloc-lock-is-being-held/' rel='bookmark' title='Using GDB’s ‘po’ command while a malloc lock is being held'>Using GDB’s ‘po’ command while a malloc lock is being held</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://petersteinberger.com/2010/12/how-to-find-strange-memory-problems-with-szone_free-szone_malloc_should_clear/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Logging, again!</title>
		<link>http://petersteinberger.com/2010/10/logging-again/</link>
		<comments>http://petersteinberger.com/2010/10/logging-again/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 11:33:46 +0000</pubDate>
		<dc:creator>studpete</dc:creator>
				<category><![CDATA[ObjectiveC]]></category>

		<guid isPermaLink="false">http://petersteinberger.com/?p=1089</guid>
		<description><![CDATA[I don&#8217;t know what&#8217;s my thing about logging, it&#8217;s just total handy, and look how my console looks since today! [cc] 2010-10-29 13:22:47:168(207) -[TVSingleRecommendView updateUI] updating recommendation to Familienstreit de luxe, http://&#8230;&#8230;&#8230;/1258578.jpg 2010-10-29 13:22:47:699(207) -[AppDelegate configureForNetworkStatus:0] configuring for 0 2010-10-29 13:22:47:702(207) -[TVEPGManager loadEPG] finished downloading epg. parsing&#8230; 2010-10-29 13:22:47:702(207) Warning: -[TVEPGManager loadEPG] No response data! [...]
Related posts:<ol>
<li><a href='http://petersteinberger.com/2010/09/better-logging-for-ios-and-mac-cocoalumberjack/' rel='bookmark' title='Better logging for iOS and Mac: cocoalumberjack'>Better logging for iOS and Mac: cocoalumberjack</a></li>
<li><a href='http://petersteinberger.com/2010/09/custom-formatter-for-the-cocoalumberjack-logging-framework/' rel='bookmark' title='Custom Formatter for the cocoalumberjack logging framework'>Custom Formatter for the cocoalumberjack logging framework</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know what&#8217;s my thing about logging, it&#8217;s just total handy, and look how my console looks since today!</p>
<p>[cc]<br />
2010-10-29 13:22:47:168(207)           -[TVSingleRecommendView updateUI] updating recommendation to Familienstreit de luxe, http://&#8230;&#8230;&#8230;/1258578.jpg <43><br />
2010-10-29 13:22:47:699(207)           -[AppDelegate configureForNetworkStatus:0] configuring for 0 <122><br />
2010-10-29 13:22:47:702(207)           -[TVEPGManager loadEPG] finished downloading epg. parsing&#8230; <80><br />
2010-10-29 13:22:47:702(207) Warning:  -[TVEPGManager loadEPG] No response data! <85><br />
2010-10-29 13:22:47:702(207) Warning:  -[TVAPI epgParsingDidFailWithError:(null)] EPG parsing failed: (null) <251><br />
2010-10-29 13:22:48:100(207)           -[TVLoginConroller viewDidAppear:(char)1] av.frame = {{150, 358}, {20, 20}} <146><br />
2010-10-29 13:22:48:100(207)           -[TVAPI login] login via http://&#8230;&#8230;&#8230;&#8230;&#8230;devicetype=i386&#038;lang=en&#038;capabilities=http_ios1 <120><br />
2010-10-29 13:22:49:102(207)           -[TVChannelManager loadChannelFileVersion:@1.0.1] botting up with version 1.0.1 <213><br />
[/CC]</p>
<p>I always printed out which function i am in (easy&#8230; just use __FUNCTION__ as macro&#8230;) but now it does that WITH ACTUAL PARAMETERS! How awesome is that? You still see some older comments that now &#8220;repeat&#8221; themselves, all I need to do now on functions is using my DDLogFunction() macro. </p>
<p>How? A blend of <a href="http://github.com/steipete/CocoaLumberjack" target="_blank" class="liexternal">cocoalumberjack</a>, my own formatter (see my blog), a modified <a href="http://github.com/steipete/HOLog" target="_blank" class="liexternal">HOLog</a>, and a modification of LOG_MACRO</p>
<p>[CC]<br />
#define LOG_MACRO(isSynchronous, lvl, flg, fnct, frmt, &#8230;) \<br />
  [DDLog log:isSynchronous                                  \<br />
       level:lvl                                            \<br />
        flag:flg                                            \<br />
        file:__FILE__                                       \<br />
    function:fnct                                           \<br />
        line:__LINE__                                       \<br />
format:[NSString stringWithFormat:@"%@ %@", __hoGetMethodCallWithArguments(&#038;self, _cmd), [NSString stringWithFormat:(frmt), ##__VA_ARGS__]]]<br />
[/CC]</p>
<p>Disclaimer: Don&#8217;t use this in released code, it&#8217;s for debugging only! (You do let the preprocessor compile out your logs, do you?)</p>
<p>Related posts:<ol>
<li><a href='http://petersteinberger.com/2010/09/better-logging-for-ios-and-mac-cocoalumberjack/' rel='bookmark' title='Better logging for iOS and Mac: cocoalumberjack'>Better logging for iOS and Mac: cocoalumberjack</a></li>
<li><a href='http://petersteinberger.com/2010/09/custom-formatter-for-the-cocoalumberjack-logging-framework/' rel='bookmark' title='Custom Formatter for the cocoalumberjack logging framework'>Custom Formatter for the cocoalumberjack logging framework</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://petersteinberger.com/2010/10/logging-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>App aftermath &#8211; voestalpine</title>
		<link>http://petersteinberger.com/2010/10/app-aftermath-voestalpine/</link>
		<comments>http://petersteinberger.com/2010/10/app-aftermath-voestalpine/#comments</comments>
		<pubDate>Sun, 24 Oct 2010 16:28:27 +0000</pubDate>
		<dc:creator>studpete</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[ObjectiveC]]></category>

		<guid isPermaLink="false">http://petersteinberger.com/?p=1061</guid>
		<description><![CDATA[My latest contract work finally hit the AppStore! (nah, actually it&#8217;s in store some time now, but couldn&#8217;t find the time to create this report It was a pretty rough ride, after two rejects and some modifications we finally were able to submit it to the store. We started around May, so this really took [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>My <a href="http://itunes.apple.com/at/app/voestalpine/id385706276?mt=8" target="_blank" class="liexternal">latest contract work</a> finally hit the AppStore! (nah, actually it&#8217;s in store some time now, but couldn&#8217;t find the time to create this report <img src='http://petersteinberger.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>It was a pretty rough ride, after two rejects and some modifications we finally were able to submit it to the store. We started around May, so this really took some time.</p>
<p><a href="http://www.knallgrau.at/" target="_blank" class="liexternal">Knallgrau</a> approached me in imminent need for an iPhone Developer, and after some talks we found an arrangement. They did most of the &#8220;early&#8221; design, but lacking sophisticated iOS design skills, I reworked most of the concept.</p>
<p>The app&#8217;s goal is of a promotional nature, so basically it&#8217;s facebook+twitter+various rss feeds+some fun stuff. Plus, you should be able to share everything, so twitter/facebook need to be bidirectional.</p>
<p><a href="http://petersteinberger.com/wp-content/uploads/2010/10/voestalpine1.png" rel="lightbox[1061]" title="voestalpine1" class="liimagelink"><img class="alignnone size-full wp-image-1075" title="voestalpine1" src="http://petersteinberger.com/wp-content/uploads/2010/10/voestalpine1.png" alt="" width="396" height="744" /></a></p>
<p>The main screen aggregates all available news feeds (rss/atom) and filters out duplicate entries based on the title and the url. The algorithm prioritizes the own rss feeds over facebook/twitter via simple iterating/comparing.</p>
<p>The parser further is pretty smart on fixing facebook links (yes, facebook does use relative urls in their rss feed&#8230; sometimes), parses images out of twitter, fixes some strange rss feeds, removes too much newlines and so on.</p>
<p>The cells feature a subtle gradient and are completely custom drawn to bet the best scrolling performance out. There&#8217;s also a featured badge if you marked some entries like the official Twitter for iPhone app does.</p>
<p>The detail page offers full text reading (if the rss feed supports it) or just presents the same text and urls (if any; e.g. twitter)</p>
<p><a href="http://petersteinberger.com/wp-content/uploads/2010/10/voestalpine2.png" rel="lightbox[1061]" title="voestalpine2" class="liimagelink"><img class="alignnone size-full wp-image-1076" title="voestalpine2" src="http://petersteinberger.com/wp-content/uploads/2010/10/voestalpine2.png" alt="" width="396" height="744" /></a></p>
<p>This was quite interesting, as we support two different types of detail view. If it&#8217;s our own site, a json call is made to get fulltext and some nicer pictures. Technically, I used three20 to lazy-load the picture and for the rich text. A UIWebView (embedded browser) would have been much slower. Also, the font is adjustable via the bottom toggles. (reloads TTStyle with different style definitions)</p>
<p>The right arrow integrates ShareKit for sending links to Facebook, Twitter, via Mail or open the page in Safari. This was quite straightforward, except getting the xAuth data from Twitter (to present a nicer NATIVE credentials system).</p>
<p><a href="http://petersteinberger.com/wp-content/uploads/2010/10/voestalpine3.png" rel="lightbox[1061]" title="voestalpine3" class="liimagelink"><img class="alignnone size-full wp-image-1077" title="voestalpine3" src="http://petersteinberger.com/wp-content/uploads/2010/10/voestalpine3.png" alt="" width="396" height="744" /></a></p>
<p>The bottom ends with a source marker (the arrow is just a cell background) and integration for facebook likes. Which normally isn&#8217;t possible. I solved that issue with using a UIWebView and some tricky code to remove the shadows that would ruin the scrolling experience. I opensourced this part on my blog, some month ago. It&#8217;s not perfect that you need to login twice into facebook to use all featuers (once for ShareKit/FB  (auth key) and once for the web version (cookie))</p>
<p><a href="http://petersteinberger.com/wp-content/uploads/2010/10/voestalpine4.png" rel="lightbox[1061]" title="voestalpine4" class="liimagelink"><img class="alignnone size-full wp-image-1078" title="voestalpine4" src="http://petersteinberger.com/wp-content/uploads/2010/10/voestalpine4.png" alt="" width="396" height="744" /></a></p>
<p>For the favorites i could have used CoreData. But that&#8217;d be too much for just a FeedItem, so i solved that with cocoa serialization and some cocoa magic.</p>
<p><script src="http://gist.github.com/636564.js?file=gistfile1.txt"></script></p>
<p>TPAutoArchiver automatically iterates over the object&#8217;s properties, it&#8217;s under MIT and you can get it <a href="http://retaincount.com/blog/?p=7" target="_blank" class="liexternal">here</a>. It&#8217;s super handy and in my personal class toolkit now.</p>
<p>The Map was pretty straightforward, except that I unintentionally made the app view too large, hiding the &#8220;Google&#8221; behind the TabBar</p>
<p><a href="http://petersteinberger.com/wp-content/uploads/2010/10/voestalpine5.jpg" rel="lightbox[1061]" title="voestalpine5" class="liimagelink"><img class="alignnone size-full wp-image-1080" title="voestalpine5" src="http://petersteinberger.com/wp-content/uploads/2010/10/voestalpine5.jpg" alt="" width="395" height="737" /></a></p>
<p>The Quiz is also quite interesting. Questions are parsed from a json to be flexible and have the ability to add further quizes without explicit app updates. I animated the questions via plain ol&#8217; UIView beginAnimations and multiple tableviews &#8211; which is super smooth and not as heavy as a new uiviewcontroller (which also wouldn&#8217;t make that much sense)</p>
<p>The rest is quite straightforward. Goodies are wallpapers that can be saved to the image dir; the voestalpine-title is touchable and opens a contact ready to be saved (which is super-nice once you get around the framework and all it&#8217;s ugly ABPersonSetImageData, ABMultiValueAddValueAndLabel calls)</p>
<p>What would I do different? </p>
<p>Well, not much. Probably use one if the rss parses that are available now (and were&#8217;t good enough the time i checked last, like <a href="http://github.com/greenisus/cocoa-rss" target="_blank" class="liexternal">cocoa-rss</a>, <a href="http://github.com/mwaterfall/MWFeedParser" target="_blank" class="liexternal">MWFeedParser</a> or <a href="http://github.com/kballard/feedparser" target="_blank" class="liexternal">feedparser</a>.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://petersteinberger.com/2010/10/app-aftermath-voestalpine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Mock ASIHTTPRequest With OCMock And Blocks</title>
		<link>http://petersteinberger.com/2010/10/how-to-mock-asihttprequest-with-ocmock-and-blocks/</link>
		<comments>http://petersteinberger.com/2010/10/how-to-mock-asihttprequest-with-ocmock-and-blocks/#comments</comments>
		<pubDate>Sun, 24 Oct 2010 15:48:52 +0000</pubDate>
		<dc:creator>studpete</dc:creator>
				<category><![CDATA[ObjectiveC]]></category>

		<guid isPermaLink="false">http://petersteinberger.com/?p=1082</guid>
		<description><![CDATA[Mocking asynchronous http calls is always kinda tricky. And it doesn&#8217;t become any easier if you use blocks too. And since my fork of asi-http-request finally is about to merge (check out the blocks-test branch!), we have to work on this. First, we need some basic block infrastructure. Add this to your project (or better, to [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Mocking asynchronous http calls is always kinda tricky. And it doesn&#8217;t become any easier if you use blocks too. And since my fork of asi-http-request finally is about to merge (check out the <a href="http://github.com/pokeb/asi-http-request/commits/blocks-test" target="_blank" class="liexternal">blocks-test branch</a>!), we have to work on this.</p>
<p>First, we need some basic block infrastructure. Add this to your project (or better, to your supporting-categories-subproject):</p>
<p><script src="http://gist.github.com/643594.js?file=gistfile1.txt"></script></p>
<p>This helps us executing blocks after some delay. Async calls are most likely not to return instantly, so we want to simulate this.</p>
<p>Next, we look at <a href="http://www.mulle-kybernetik.com/software/OCMock/" target="_blank" class="liexternal">OCMock</a>. While mostly used with SenTestingKit, we use it for mocking the <a href="http://allseeing-i.com/ASIHTTPRequest/" target="_blank" class="liexternal">ASIHTTPRequest</a> &#8211; helping test our actual software. (This can really replace unit testing, if you use it in combination with UIAutomation)</p>
<p>Note: Some if this (esp. the OCMock part) can also be applied if you work with plain ol&#8217; NSURLConnection &#8211; but it&#8217;s only half the fun (and elegance)</p>
<p>Integrating OCMock is kinda tricky, be sure to use -all_load OR -force_load <LIB_PATH>. Adding both will obviously fail. Best you use the actual xcode project from the source (not the lib as they propose). Add that to Xcode and include both libOCMock.a and don&#8217;t forget to add direct dependencies to OCMockPhoneSim and OCMockPhoneDevice. This really should be simpler with their compiled lib, but they forgot to build the lib universal, leaving simulator out.</p>
<p>And you probably don&#8217;t want that code in the AppStore-build, so either create a new target or remove the project prior compiling that.</p>
<p>So, now to the delicate stuff. I use preprocessor defines to enable/disable the mocking. The actual mocking part is between #ifdef MOCK_HANDSHAKE and #endif, but here&#8217;s a more complete example to get the idea&#8230;</p>
<p><script src="http://gist.github.com/643615.js?file=gistfile1.m"></script></p>
<p>See how we set the 3 seconds delay in RunAfterDelay, creating yet another block that calls our completionBlock, while playing nice with memory. The actual response is loaded from the textfile &#8220;mock_handshake.txt&#8221; that&#8217;s included in our main project.</p>
<p>Please drop me a line if you believe this was helpful.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://petersteinberger.com/2010/10/how-to-mock-asihttprequest-with-ocmock-and-blocks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>It&#8217;s christmas already?</title>
		<link>http://petersteinberger.com/2010/10/its-christmas-already/</link>
		<comments>http://petersteinberger.com/2010/10/its-christmas-already/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 16:53:58 +0000</pubDate>
		<dc:creator>studpete</dc:creator>
				<category><![CDATA[ObjectiveC]]></category>

		<guid isPermaLink="false">http://petersteinberger.com/?p=1069</guid>
		<description><![CDATA[spoiler: no, it isn&#8217;t But &#8211; here&#8217;s some new awesome stuff for iOS devs&#8230; FunctionKit &#8230; just see for yourself. FunctionalKit on steroids (and c++) ELCImagePickerController A clone of the UIImagePickerController using the Assets Library Framework allowing for multiple asset selection. Obviously iOS4 only. (Assets use blocks and were introduced in iOS4) ActiveRecord Fetching for Core [...]
Related posts:<ol>
<li><a href='http://petersteinberger.com/2009/11/multithreading-with-core-data/' rel='bookmark' title='Multithreading with Core Data'>Multithreading with Core Data</a></li>
<li><a href='http://petersteinberger.com/2010/09/fixing-nsfetchedresultscontroller/' rel='bookmark' title='Fixing NSFetchedResultsController'>Fixing NSFetchedResultsController</a></li>
<li><a href='http://petersteinberger.com/2010/10/diving-into-coredata-again/' rel='bookmark' title='Diving into CoreData, again'>Diving into CoreData, again</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>spoiler: no, it isn&#8217;t <img src='http://petersteinberger.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>But &#8211; here&#8217;s some new awesome stuff for iOS devs&#8230;</p>
<ul>
<li><a href="http://github.com/jonsterling/FunctionKit" target="_blank" class="liexternal">FunctionKit</a> &#8230; just see for yourself. FunctionalKit on steroids (and c++)</li>
<li><a href="http://github.com/elc/ELCImagePickerController" target="_blank" class="liexternal">ELCImagePickerController</a><br />
A clone of the UIImagePickerController using the Assets Library Framework allowing for multiple asset selection. Obviously iOS4 only. (Assets use blocks and were introduced in iOS4)</li>
<li><a href="http://github.com/magicalpanda/activerecord-fetching-for-core-data" target="_blank" class="liexternal">ActiveRecord Fetching for Core Data</a><br />
More than just helper, a complete framework to work hassle-free with Core Data</li>
<li><a href="http://github.com/probablycorey/seriously" target="_blank" class="liexternal">Seriously</a><br />
The Objective-C HTTP library that Apple should have created, seriously.</li>
<li><a href="http://mschrag.github.com/" target="_blank" class="liexternal">Slow Motion Enabler</a> &#8220;slowmo&#8221; &#8211; watch your animations 10x as slow.</li>
<li><a href="http://mschrag.github.com/" target="_blank" class="liexternal">speedlimit</a> &#8211; slows down network speed, simulate 3G, Edge, GPRS with iPhone Simulator</li>
</ul>
<p>You should <a href="http://github.com/steipete" target="_blank" class="liexternal">follow me on GitHub</a> to get all those classy gems in your daily stream.</p>
<p>Related posts:<ol>
<li><a href='http://petersteinberger.com/2009/11/multithreading-with-core-data/' rel='bookmark' title='Multithreading with Core Data'>Multithreading with Core Data</a></li>
<li><a href='http://petersteinberger.com/2010/09/fixing-nsfetchedresultscontroller/' rel='bookmark' title='Fixing NSFetchedResultsController'>Fixing NSFetchedResultsController</a></li>
<li><a href='http://petersteinberger.com/2010/10/diving-into-coredata-again/' rel='bookmark' title='Diving into CoreData, again'>Diving into CoreData, again</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://petersteinberger.com/2010/10/its-christmas-already/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Diving into CoreData, again</title>
		<link>http://petersteinberger.com/2010/10/diving-into-coredata-again/</link>
		<comments>http://petersteinberger.com/2010/10/diving-into-coredata-again/#comments</comments>
		<pubDate>Mon, 18 Oct 2010 14:47:33 +0000</pubDate>
		<dc:creator>studpete</dc:creator>
				<category><![CDATA[ObjectiveC]]></category>

		<guid isPermaLink="false">http://petersteinberger.com/?p=1065</guid>
		<description><![CDATA[Even after more than a year, CoreData still surprises frustrates enlightens me. First of, seems I&#8217;m doing it all wrong, the whole time. Go get mogenerator + Xmo&#8217;d. This should be in the Apple Docs, so useful! mogenerator autocreates core data class files everytime you save the .xcdatamodel file. All you have to do is [...]
Related posts:<ol>
<li><a href='http://petersteinberger.com/2009/11/coredata-and-mergechangesfromcontextdidsavenotification/' rel='bookmark' title='CoreData and mergeChangesFromContextDidSaveNotification'>CoreData and mergeChangesFromContextDidSaveNotification</a></li>
<li><a href='http://petersteinberger.com/2010/03/better-iphonemac-logging-with-gtmlogger/' rel='bookmark' title='Better iPhone/Mac logging with GTMLogger'>Better iPhone/Mac logging with GTMLogger</a></li>
<li><a href='http://petersteinberger.com/2011/12/use-xcodegit-to-automatically-version-your-apps/' rel='bookmark' title='Use Xcode+git to automatically version your apps'>Use Xcode+git to automatically version your apps</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Even after more than a year, CoreData still <del datetime="2010-10-18T13:01:48+00:00">surprises</del> <del datetime="2010-10-18T13:01:48+00:00">frustrates</del> enlightens me.</p>
<p>First of, seems I&#8217;m doing it all wrong, the whole time. Go get <a href="http://rentzsch.github.com/mogenerator/" target="_blank" class="liexternal">mogenerator</a> + Xmo&#8217;d. This should be in the Apple Docs, so useful! mogenerator autocreates core data class files everytime you save the .xcdatamodel file. All you have to do is <a href="http://stackoverflow.com/questions/3563145" target="_blank" class="liexternal">add a &#8220;xmod&#8221; comment on that file</a>. (and don&#8217;t forget to add the auto-added files as a <a href="http://stackoverflow.com/questions/3752471/nsfetchedresultscontroller-always-returns-nsmanagedobject-objects-instead-of-cust" target="_blank" class="liexternal">compile-target</a>, or you end up with NSManagedObjects)</p>
<p><a href="http://menial.co.uk/software/base/" target="_blank" class="liexternal">Base</a> is an awesome sqlite browser, much better than that <a href="http://sqlitebrowser.sourceforge.net/" target="_blank" class="liexternal">no longer maintained QT stuff</a> i had before.</p>
<p>You can s<a href="http://shanecrawford.org/2008/57/coredatas-default-date-value/" target="_blank" class="liexternal">et default data values</a>. Even “last Tuesday at dinner” works here! nah, you can&#8217;t, this translates <a href="http://iphonedevelopment.blogspot.com/2009/07/core-data-default-dates-in-data-model.html" target="_blank" class="liexternal">at compile time</a>.</p>
<p>Need more? check out &#8220;<a href="http://blog.magicalpanda.com/iosdevcon-slides" target="_blank" class="liexternal">Core Data Tips &amp; Tricks</a>&#8220;</p>
<p>Related posts:<ol>
<li><a href='http://petersteinberger.com/2009/11/coredata-and-mergechangesfromcontextdidsavenotification/' rel='bookmark' title='CoreData and mergeChangesFromContextDidSaveNotification'>CoreData and mergeChangesFromContextDidSaveNotification</a></li>
<li><a href='http://petersteinberger.com/2010/03/better-iphonemac-logging-with-gtmlogger/' rel='bookmark' title='Better iPhone/Mac logging with GTMLogger'>Better iPhone/Mac logging with GTMLogger</a></li>
<li><a href='http://petersteinberger.com/2011/12/use-xcodegit-to-automatically-version-your-apps/' rel='bookmark' title='Use Xcode+git to automatically version your apps'>Use Xcode+git to automatically version your apps</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://petersteinberger.com/2010/10/diving-into-coredata-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

