<?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</title>
	<atom:link href="http://petersteinberger.com/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>Apple&#8217;s ballsy move</title>
		<link>http://petersteinberger.com/2011/02/apples-ballsy-move/</link>
		<comments>http://petersteinberger.com/2011/02/apples-ballsy-move/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 20:52:26 +0000</pubDate>
		<dc:creator>studpete</dc:creator>
				<category><![CDATA[Opinions]]></category>

		<guid isPermaLink="false">http://petersteinberger.com/?p=1161</guid>
		<description><![CDATA[If you&#8217;re not living in the Apple Bubble, you can boost your knowledge about Apple&#8217;s latest ballsy move. In a nutshell, Apple now wants 30% of everything you purchase or use with an iOS device. And you are not allowed to make it more expensive to compensate the losses. If your margin is less than those [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re not living in the Apple Bubble, you can <a href="http://www.blog.montgomerie.net/thoughts-on-ios-content-purchase" target="_blank" class="liexternal">boost your knowledge</a> about Apple&#8217;s latest ballsy move.</p>
<p>In a nutshell, Apple now wants 30% of everything you purchase or use with an iOS device. And you are not allowed to make it more expensive to compensate the losses. If your margin is less than those magic 30%, you&#8217;re screwed.</p>
<p>Yes, for customers (short thought) it&#8217;s a good thing. You no longer have to give away your details (like name, address, credit card) and instead can use a payment provider you already trust (Apple) which handles everything and does not give away your contact details.</p>
<blockquote><p>“Our philosophy is simple—when Apple brings a new subscriber to the app, Apple earns a 30 percent share; when the publisher brings an existing or new subscriber to the app, the publisher keeps 100 percent and Apple earns nothing,” &#8211; <a href="http://www.apple.com/pr/library/2011/02/15appstore.html" target="_blank" class="liexternal">Steve Jobs</a></p></blockquote>
<p>To keep a 70/30 cut for selling apps is one thing &#8211; here Apple offers service, like reviewing (hoho), distributing the app through their high-speed network, advertisement (if you&#8217;re lucky) and the whole AppStore-Infrastructure.</p>
<p>What do they do with In-App purchases? Handling your payments. No hosting, no additional service. That&#8217;s just not worth 30%. Google today launched <a href="http://www.google.com/landing/onepass/" target="_blank" class="liexternal">Google One Pass</a>, a solution for offering digital content &#8211; they take much more reasonable 10%. Paypal takes 3%.</p>
<blockquote><p>Everyone&#8217;s talking about &#8216;publishers&#8217; with these new App Store rules. What about vendors? They&#8217;re the ones getting royally screwed. &#8211; <a href="https://twitter.com/alanquatermain/status/37927983750717440" target="_blank" class="liexternal">Jim Dovey</a>, former developer of <a href="http://www.kobobooks.com/" target="_blank" class="liexternal">Kobo Books</a>.</p></blockquote>
<p>Many publishers and developers are screaming now, that Apple destroys their whole business. It&#8217;s because most businesses don&#8217;t have a 30% span they can share. So <strong>Apple is, in fact, asking them to lose money</strong>.</p>
<p>It&#8217;s also about process. Setting up IAP is a pain. Keeping it in sync with your library is even worse. And there are also limits &#8211; IAP allows up to 3500 items &#8211; Amazon Kindle currently has about 2,5 MILLION items.</p>
<p>I don&#8217;t see Amazon giving Apple 30% for just being on the iPad/iPhone. Furthermore, they would have to offer IAP at the same price to just stay in the store. Their current solution, which is offering a link to the Amazon Store that opens in Safari, is no longer allowed. (No external linking to the site shop).</p>
<p>So their only viable option: remove the App from the AppStore. Same for Netflix, Hulu, Pandora, Kobo, Zinio Magazines and many other services. This is bad for customers, and bad for Apple. And it makes me angry and sad. Damn it, it&#8217;s my device, I paid $$$ on it, and now they are taking away my apps. Not fair. It&#8217;s also utmost greedy &#8211; Apple&#8217;s not the company that would in any way <em>need</em> this extra money.</p>
<p>I genuinely hope that they end this madness.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://petersteinberger.com/2011/02/apples-ballsy-move/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sometimes we do it for the money, don&#8217;t we?</title>
		<link>http://petersteinberger.com/2011/02/sometimes-we-do-it-for-the-money-dont-we/</link>
		<comments>http://petersteinberger.com/2011/02/sometimes-we-do-it-for-the-money-dont-we/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 11:48:33 +0000</pubDate>
		<dc:creator>studpete</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://petersteinberger.com/?p=1143</guid>
		<description><![CDATA[(picture by Chi King) In the end, money is the motivation why we all work. I earned good money at my last company, so why quit and go freelance? Cause I care about my work, and with freelancing you have a choice what and with whom you work for. It wasn&#8217;t always easy, and I [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p><a href="http://petersteinberger.com/wp-content/uploads/2011/02/5025589369_b9a0cc9952.jpg" rel="lightbox[1143]" title="5025589369_b9a0cc9952"><img class="alignnone size-full wp-image-1156" title="5025589369_b9a0cc9952" src="http://petersteinberger.com/wp-content/uploads/2011/02/5025589369_b9a0cc9952.jpg" alt="" width="500" height="407" /><br />
</a>(picture by <a href="http://www.flickr.com/photos/davelau/5025589369/" target="_blank" class="liexternal">Chi King</a>)</p>
<p>In the end, money is the motivation why we all work. I earned good money at my last company, so why quit and go freelance? Cause <strong>I care about my work</strong>, and with freelancing you have a choice what and with whom you work for.</p>
<p>It wasn&#8217;t always easy, and I learned a lot. In fact, I am still learning so much every day. Fortunately, the mobile space is growing so crazy fast &#8211; most of the times I just have to say &#8220;no&#8221; to inquiries cause I&#8217;m already that overbooked. And being damn good at it supposedly helps, at least some customers argue. But to be <em>really</em> good at work, some factors need to be there:</p>
<p><strong>Freedom to decide. </strong>Not every aspect, but its so tiresome if costumers think they know better, when in fact they simply don&#8217;t. Some freedom in features, design assures that you are able to care for the project. Let loose, give us some latitude.</p>
<p><strong>Not too hard constraints on time</strong>. I don&#8217;t do apps that need to be finished &#8220;in two weeks from now&#8221;. When the most limiting factor is time, you pay big times afterwards, except maybe if it&#8217;s a trashy throwaway project. Especially with iOS, where the platform is iterating that fast, support is an issue and far more expensive if you have spagetti code.</p>
<p><strong>Money.</strong> It&#8217;s a bad departure point if I feel undercharged to start with. I made that mistake a few times when I didn&#8217;t knew what I was worth. It&#8217;s generally difficult if you need to shoot a project price out of the blue. The better thing &#8482; is to be paid a daily rate. I tell my customers what I get per day, and how long I think it will take, with the best approximation I can do. They get my status reports and with techniques like <a href="https://github.com/TheRealKerni/Hockey" target="_blank" class="liexternal">Hockey</a> (which I&#8217;m currently rewriting, but that&#8217;s another story) they can watch the progress.</p>
<p>If they suddenly want feature X instead if Y, i just tell them how much longer it will take. Those things happen, they did EVERY SINGLE TIME. With a fixed project budget you start arguing what&#8217;s included and what not, how much that would be extra, that you need a new contract &#8211; it&#8217;s a hassle. A daily rate solves this all. The greatest exercise is getting people to understand. Luckily I am in the position where a big company grasped this &#8211; it turned out great. (and I&#8217;m still doing stuff for them)</p>
<p>Please, if you have bitching customers, just send them a <a href="http://www.winwithoutpitching.com/why-i-charge-more" target="_blank" class="liexternal">variation of this letter</a>. If they don&#8217;t unterstand, move on.</p>
<p><strong>Theme</strong>. I&#8217;m not interested in augmented reality. I don&#8217;t think it&#8217;s a good idea, i don&#8217;t use it, so I simply don&#8217;t write apps for it.  Sure i <em>could</em> write them, but why? Some projects are not paid that well &#8211; yet fascinating in some way, or need me to learn something new. Those are the ones I go for. You&#8217;re only getting shitty projects? Make one yourself! Damn it! It has NEVER been easier.</p>
<p>In fact, that&#8217;s my next big thing. I feel like iOS is my home now, it&#8217;s no challenge any more. I love writing apps and will continue thinking, designing, writing and publishing them. Part time.</p>
<p>My next &#8220;big thing&#8221; is already on the corner, with a new language (that keeps the <a href="http://www.sproutcore.com/" target="_blank" class="liexternal">Cocoa mindset</a>), new challenges and a greate co-founder.  I&#8217;ll announce more soon.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://petersteinberger.com/2011/02/sometimes-we-do-it-for-the-money-dont-we/feed/</wfw:commentRss>
		<slash:comments>2</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>3MobileTV in the News</title>
		<link>http://petersteinberger.com/2010/12/3mobiletv-in-the-news/</link>
		<comments>http://petersteinberger.com/2010/12/3mobiletv-in-the-news/#comments</comments>
		<pubDate>Sun, 12 Dec 2010 01:51:51 +0000</pubDate>
		<dc:creator>studpete</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[Vienna]]></category>

		<guid isPermaLink="false">http://petersteinberger.com/?p=1123</guid>
		<description><![CDATA[My latest app (which is currently in review) was featured in an german news article. Man, this makes you proud! A more in-depth blogpost with all some technical details will follow soon. And hell, I even have the gloves No related posts.
No related posts.]]></description>
			<content:encoded><![CDATA[<p>My latest app (which is currently in review) was featured in an german news article. Man, this makes you proud!</p>
<p>A more in-depth blogpost with all some technical details will follow soon. And hell, I even have the <a href="http://www.etreshop.com/catalogue/product/10/" target="_blank" class="liexternal">gloves</a> <img src='http://petersteinberger.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><a href="http://petersteinberger.com/wp-content/uploads/2010/12/3mobiletv.jpg" rel="lightbox[1123]" title="3mobiletv" class="liimagelink"><img class="alignnone size-full wp-image-1125" title="3mobiletv" src="http://petersteinberger.com/wp-content/uploads/2010/12/3mobiletv.jpg" alt="" width="800" height="498" /></a></p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://petersteinberger.com/2010/12/3mobiletv-in-the-news/feed/</wfw:commentRss>
		<slash:comments>0</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>synbolicatecrash troubles?</title>
		<link>http://petersteinberger.com/2010/12/synbolicatecrash-troubles/</link>
		<comments>http://petersteinberger.com/2010/12/synbolicatecrash-troubles/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 17:17:04 +0000</pubDate>
		<dc:creator>studpete</dc:creator>
				<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://petersteinberger.com/?p=1109</guid>
		<description><![CDATA[Just a small tip, if you&#8217;re using CrashReporterDemo to manage your bug reports (Do it yourself! don&#8217;t rely on Apple! They&#8217;re far to slow, and it doesn&#8217;t work for AdHocs..) So, with Hockey (you&#8217;re doing it wrong if you don&#8217;t use it), there&#8217;s the script that autouploads the adhoc files on the server. And of [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Just a small tip, if you&#8217;re using <a href="https://github.com/TheRealKerni/CrashReporterDemo" target="_blank" class="liexternal">CrashReporterDemo</a> to manage your bug reports<br />
(Do it yourself! don&#8217;t rely on Apple! They&#8217;re far to slow, and it doesn&#8217;t work for AdHocs..)</p>
<p>So, with <a href="https://github.com/TheRealKerni/Hockey" target="_blank" class="liexternal">Hockey</a> (you&#8217;re doing it wrong if you don&#8217;t use it), there&#8217;s the script that autouploads the adhoc files on the server. And of course they get archived.</p>
<p>But ha! There&#8217;s the catch! Instead of naming them like</p>
<p>com.youdomain.app.1.0.0, change it to AppName.com.youdomain.app.1.0.0</p>
<p>Why, you ask? Well, symbolicatecrash is some perl crap and trunicates the appname after a dot. It&#8217;ll find you files, but not the executable within (it will search for &#8220;com&#8221; in the first example)</p>
<p>You&#8217;ll get errors (if run with -vv) like &#8220;Did not find executable for dsym&#8221; and &#8220;Warning: Can’t find any unstripped binary that matches version of &#8230;&#8221;</p>
<p>So, change lines of<br />
$bundleIdentifier $bundleVersion.app<br />
to<br />
$executableName.$bundleIdentifier.$bundleVersion.app</p>
<p>and you&#8217;re good to go. </p>
<p>Update: And don&#8217;t forget to NOT use the symbolicatecrash from Apple, instead use <a href="https://gist.github.com/316924" target="_blank" class="liexternal">this</a> one.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://petersteinberger.com/2010/12/synbolicatecrash-troubles/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>UPC gibt sich mehr Rechte? Nicht mit mir!</title>
		<link>http://petersteinberger.com/2010/11/upc-gibt-sich-mehr-rechte-nicht-mit-mir/</link>
		<comments>http://petersteinberger.com/2010/11/upc-gibt-sich-mehr-rechte-nicht-mit-mir/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 11:39:28 +0000</pubDate>
		<dc:creator>studpete</dc:creator>
				<category><![CDATA[Vienna]]></category>

		<guid isPermaLink="false">http://petersteinberger.com/?p=1099</guid>
		<description><![CDATA[(This is a post about the austrian internet provider UPC, so don&#8217;t mind if you don&#8217;t speak austrian, it&#8217;s probably not interesting for you anyway) Ab 1. Jänner gelten für Bestandskunden neue AGBs bei UPC. Wer nicht will, dass seine persönlichen Daten für Marketingzwecke, Bonitätsprüfungen und weitere Analysen bereitgestellt werden, sollte das dem Provider mitteilen. [...]
Related posts:<ol>
<li><a href='http://petersteinberger.com/2010/02/this-weeks-links/' rel='bookmark' title='This Week&#8217;s Links'>This Week&#8217;s Links</a></li>
<li><a href='http://petersteinberger.com/2010/06/raus-aus-dem-t-mobiletele-ring-vertrag-jetzt-ist-eure-chance/' rel='bookmark' title='Raus aus dem T-Mobile/tele.ring Vertrag? Jetzt ist eure Chance!'>Raus aus dem T-Mobile/tele.ring Vertrag? Jetzt ist eure Chance!</a></li>
<li><a href='http://petersteinberger.com/2010/06/osterreichische-ios-entwickler/' rel='bookmark' title='Österreichische iOS-Entwickler'>Österreichische iOS-Entwickler</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>(This is a post about the austrian internet provider UPC, so don&#8217;t mind if you don&#8217;t speak austrian, it&#8217;s probably not interesting for you anyway)</p>
<p>Ab 1. Jänner gelten für Bestandskunden <a href="http://www.upc.at/ueber_upc/agb/" target="_blank" class="liexternal">neue AGBs bei UPC</a>. Wer nicht will, dass seine persönlichen Daten für Marketingzwecke, Bonitätsprüfungen und weitere Analysen bereitgestellt werden, sollte das dem Provider mitteilen.  (<a href="http://help.orf.at/stories/1668849/" target="_blank" class="liexternal">siehe ORF Artikel</a>)</p>
<p><strong>Update 1</strong>: Das ist keine Kündigung, es geht nur um Rechte, die sich UPC einverleibt, die sie nicht benötigen.</p>
<p><strong>Update 2</strong>: Einer meiner Leser hat vorgeschlagen, dass man sich den Widerspruch bestätigen lassen soll, habe den Text dahingehend aktualisiert.</p>
<p>Widersprochen kann <a href="http://www.upc.at/kundenservice/kontakt/wien/" target="_blank" class="liexternal">per Mail oder Fax</a>, hier mit dem Text-Template:</p>
<p>[CC]</p>
<p>Meine Kundennummer: xxxxxxxxxxxx</p>
<p>Datum: TT.MM.JJJJ</p>
<p>Sehr geehrte Damen und Herren,</p>
<p>hiermit widerrufe ich die Zustimmung zur Verwendung meiner Stammdaten, Verkehrsdaten und sonstiger personenbezogener Daten, welche in den Punkten 19.6, 19.7 und 19.8 Ihrer ab 1.1.2011 gültigen Allgemeinen Geschäftsbedingungen formuliert ist.<br />
Dies erfolgt gemäß dem darin zugestandenen Widerrufsrecht.</p>
<p>Ich erwarte von UPC eine Bestätigung per E-Mail, in der Sie meinen Einspruch zur Kenntnis nehmen und ihm Folge leisten.</p>
<p>Mit freundlichen Grüßen,<br />
xxxxxxxxxxxxx</p>
<p>[/CC]</p>
<p>Related posts:<ol>
<li><a href='http://petersteinberger.com/2010/02/this-weeks-links/' rel='bookmark' title='This Week&#8217;s Links'>This Week&#8217;s Links</a></li>
<li><a href='http://petersteinberger.com/2010/06/raus-aus-dem-t-mobiletele-ring-vertrag-jetzt-ist-eure-chance/' rel='bookmark' title='Raus aus dem T-Mobile/tele.ring Vertrag? Jetzt ist eure Chance!'>Raus aus dem T-Mobile/tele.ring Vertrag? Jetzt ist eure Chance!</a></li>
<li><a href='http://petersteinberger.com/2010/06/osterreichische-ios-entwickler/' rel='bookmark' title='Österreichische iOS-Entwickler'>Österreichische iOS-Entwickler</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://petersteinberger.com/2010/11/upc-gibt-sich-mehr-rechte-nicht-mit-mir/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
	</channel>
</rss>

