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

<channel>
	<title>Aral Balkan &#187; Open Source</title>
	<atom:link href="http://aralbalkan.com/category/open-source/feed" rel="self" type="application/rss+xml" />
	<link>http://aralbalkan.com</link>
	<description>Passionate geekisms.</description>
	<lastBuildDate>Wed, 01 Feb 2012 18:53:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
		<item>
		<title>Notes on Migrating from XAuthTwitterEngine to MGTwitterEngine</title>
		<link>http://aralbalkan.com/3628</link>
		<comments>http://aralbalkan.com/3628#comments</comments>
		<pubDate>Wed, 03 Nov 2010 01:22:04 +0000</pubDate>
		<dc:creator>Aral</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[mgtwitterengine]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[xauthtwitterengine]]></category>

		<guid isPermaLink="false">http://aralbalkan.com/?p=3628</guid>
		<description><![CDATA[Unable to sleep, I instead spent the last hour porting Feathers from XAuthTwitterEngine to MGTwitterEngine (see my previous post for background). Here are a few notes to help you for when you decide to the same: Replace all occurrences of XAuthTwitterEngine in the code with MGTwitterEngine (and remove references to XAuthTwitterEngineDelegate). The designated initializer for [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />Unable to sleep, I instead spent the last hour porting <a href="http://feathersapp.com">Feathers</a> from XAuthTwitterEngine to MGTwitterEngine (see <a href="http://aralbalkan.com/3612">my previous post</a> for background). </p>
<p>Here are a few notes to help you for when you decide to the same:</p>
<p><span id="more-3628"></span></p>
<ul>
<li>Replace all occurrences of XAuthTwitterEngine in the code with MGTwitterEngine (and remove references to XAuthTwitterEngineDelegate).</li>
<li>The designated initializer for MGTwitterEngine is <code>initWithDelegate</code> (as opposed to <code>initXAuthWithDelegate</code> in XAuthTwitterEngine) – make sure you update your code.</li>
<li>Remember to call <code>setConsumerKey:secret:</code> on the MGTwitterEngine instance before anything else. MGTwitterEngine doesn't have XAuthTwitterEngines <code>consumerKey</code> and <code>consumerSecret</code> properties.</li>
<li>Remember to call <code>setAccessToken:</code> on the MGTwitterEngine instance before trying to make calls (XAuthTwitterEngine doesn't have/call the <code>cachedTwitterXAuthAccessTokenStringForUsername:</code> delegate method to request the access token.</li>
<li>Note that MGTwitterEngine takes <code>OAToken</code> instances (XAuthTwitterEngine used to take the HTTP response string). See the migration section, below, for more information on switching over.</li>
<li>Remember that your MGTwitterEngineDelegate success and failure methods will get called for the xAuth token exchange call also.</li>
</ul>
<h2>Migrating your users</h2>
<p>The important bit to watch out for is migrating your users from XAuthTwitterEngine to MGTwitterEngine without asking them to re-authenticate. To do this, you have to create an OAToken instance from the saved HTTP response string and save the token key and secret in the keychain. Once you've done this, you can safely ignore the legacy HTTP response string in future calls.</p>
<p>To translate the HTTP response bodies used by XAuthTwitterEngine to OATokens, use:</p>
<pre class="objc">OAToken *token = <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>OAToken alloc<span style="color: #002200;">&#93;</span> initWithHTTPResponseBody:tokenString<span style="color: #002200;">&#93;</span>;</pre>
<p>Hope this helps you while migrating.</p>
]]></content:encoded>
			<wfw:commentRss>http://aralbalkan.com/3628/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>XAuthTwitterEngine deprecated, use MGTwitterEngine (&amp; new MGTwitterEngine demo app released)</title>
		<link>http://aralbalkan.com/3612</link>
		<comments>http://aralbalkan.com/3612#comments</comments>
		<pubDate>Tue, 02 Nov 2010 16:55:33 +0000</pubDate>
		<dc:creator>Aral</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tools and Utilities]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[mgtwitterengine]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[xauth]]></category>
		<category><![CDATA[xauthtwitterengine]]></category>

		<guid isPermaLink="false">http://aralbalkan.com/?p=3612</guid>
		<description><![CDATA[In March of this year, I created a Twitter library called XAuthTwitterEngine based on Matt Gemmell's awesome MGTwitterEngine library and the excellent work (and with the assistance) of a number of great developers (including Ben Gottlieb, Jon Crosby, Chris Kimpton, and Isaiah Carew, Steve Reynolds, and Norio Nomura). Back then, MGTwitterEngine didn't have oAuth/xAuth support [...]]]></description>
			<content:encoded><![CDATA[<p id="top" /><img src="/images/mgtwitterenginedemo.png" alt="MGTwitterEngineDemo UI" style="float:right; margin-left:1em;margin-bottom:0.5em;width:50%" class="transparent">In March of this year, I created a Twitter library called <a href="http://aralbalkan.com/3133">XAuthTwitterEngine</a> based on <a href="http://mattgemmell.com">Matt Gemmell</a>'s awesome <a href="http://github.com/mattgemmell/MGTwitterEngine">MGTwitterEngine</a> library and the excellent work (and with the assistance) of a number of great developers (including Ben Gottlieb, <a href="http://code.google.com/p/oauth/">Jon Crosby</a>, <a href="http://github.com/kimptoc/MGTwitterEngine-1.0.8-OAuth-MyTwitter/tree/master">Chris Kimpton</a>, and <a href="http://github.com/yourhead/OAuth_ObjC_Test_App/tree/master">Isaiah Carew</a>, <a href="http://www.reynoldsftw.com/">Steve Reynolds</a>, and <a href="http://github.com/norio-nomura/ntlniph/commit/5ce25d68916cd45254c7ff2ba9b91de4f324899a">Norio Nomura</a>). Back then, MGTwitterEngine didn't have oAuth/xAuth support and I built XAuthTwitterEngine as a stop-gap, with the intension of back-porting to MGTwitterEngine at some point.</p>
<p>Well, MGTwitterEngine has had excellent oAuth/xAuth for some time now and I finally got round to checking it out today only to realize just how much progress they've made. It's definitely time to deprecate XAuthTwitterEngine and start using MGTwitterEngine again (so I am back-porting <a href="http://feathersapp.com">Feathers</a> to MGTwitterEngine at the moment).</p>
<p><span id="more-3612"></span></p>
<h2>New demo</h2>
<p>One of my goals in releasing XAuthTwitterEngine was to have a simple demo that developer's could use as a reference – something that "just works". I still think that's necessary for MGTwitterEngine so I created a new one based on the demo project in XAuthTwitterEngine. </p>
<p><a href="http://github.com/aral/MGTwitterEngineDemo">Check out the MGTwitterEngine demo project on Github</a>.</p>
<p>Some notes on the demo:</p>
<ul>
<li>It's an iPhone project.</li>
<li>I've removed the (frankly pain-in-the-ass) YAJL sources from the compile sources for the main target</li>
<li>I've added TouchJSON and enabled it.</li>
<li>It stores the oAuth token returned from the initial xAuth call securely in the keychain using the <a href="http://github.com/ldandersen/scifihifi-iphone/tree/master/security/">SFHFKeychainUtils helper class</a> by <a href="">Justin Williams</a>.</li>
<li><strike>I kept most of the XAuthTwitterEngine code in comments to show you the differences between the two libraries in hopes that it will aid you in migrating your apps.</strike></li>
<li>I've done minimal testing on it <strike>and haven't had a chance to clean up the code. There are blatant memory leaks, etc. which I will look into after finishing off this blog post.</strike><ins>I've cleaned up the project and removed the commented-out XAuthTwitterEngine code – it was more confusing than anything else.</li>
</ul>
<p><strike>As the first step in porting <a href="http://feathersapp.com">Feathers</a> back to MGTwitterEngine, I'm planning on evolving XAuthTwitterEngine into a façade that simply proxies calls to MGTwitterEngine. When that's ready, I'll release it as a drop-in replacement to get those of you using XAuthTwitterEngine to seamlessly and transparently switch to using the latest and greatest MGTwitterEngine (or, if you don't want to wait, </strike> <ins>Scratch that, I just had a look at it and it's definitely more trouble than it's worth – it's easier to</ins> just use the demo I liked to above as a guide to port your apps yourselves. <strike>The façade should just be an intermediary step anyway.</strike>)</p>
<p>Hope you find the demo project useful in getting up and running with MGTwitterEngine.</p>
<h2>Links</h2>
<ul>
<li><a href="http://github.com/mattgemmell/MGTwitterEngine">MGTwitterEngine</a></li>
<li><a href="http://github.com/aral/MGTwitterEngineDemo">MGTwitterEngine demo project</a></li>
<li><a href="http://aralbalkan.com/3133">XAuthTwitterEngine (deprecated)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://aralbalkan.com/3612/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>UIApplication + NetworkActivityIndicatorManager</title>
		<link>http://aralbalkan.com/3602</link>
		<comments>http://aralbalkan.com/3602#comments</comments>
		<pubDate>Sat, 23 Oct 2010 15:34:39 +0000</pubDate>
		<dc:creator>Aral</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[asynchronous]]></category>
		<category><![CDATA[category]]></category>
		<category><![CDATA[connections]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[displaying]]></category>
		<category><![CDATA[finished]]></category>
		<category><![CDATA[hiding]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[loading]]></category>
		<category><![CDATA[network activity indicator]]></category>

		<guid isPermaLink="false">http://aralbalkan.com/?p=3602</guid>
		<description><![CDATA[The Network Activity Indicator is that little spinner that shows up in the status bar when a data exchange is in progress. It's easy enough to show and hide: &#91;&#91;UIApplication sharedApplication&#93; setNetworkActivityIndicatorVisible: YES&#93;; That's cool when you only have one data exchange active at a time but what about if you have several? It can [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />The Network Activity Indicator is that little spinner that shows up in the status bar when a data exchange is in progress. It's easy enough to show and hide: </p>
<pre class="objc"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span> setNetworkActivityIndicatorVisible: YES<span style="color: #002200;">&#93;</span>;</pre>
<p><span id="more-3602"></span></p>
<p>That's cool when you only have one data exchange active at a time but what about if you have several? It can quickly become unwieldy to keep track of when to display the network activity indicator. e.g., I've been enjoying the <a href="http://code.google.com/p/gtm-http-fetcher/">Google Toolbox for Mac - HTTP Fetcher</a> (GTMHTTPFetcher) recently but it doesn't include built-in support for managing the network activity indicator.</p>
<p>Enter a simple little category on UIApplication to make it easier. With the UIApplication+NetworkActivityIndicatorManager category, all you have to do is to inform the application that a new data connection has started (or ended) and it will keep track of whether or not to display the network activity indicator.</p>
<h2>Download</h2>
<p>Download <a href="/downloads/UIApplication+NetworkActivityIndicatorManager.zip">UIApplication+NetworkActivityIndicatorManager.zip</a> (3 KB).</p>
<h2>Usage</h2>
<p>Start by adding the class to your Xcode project and importing the category: </p>
<pre class="objc"><span style="color: #339900;">#import &quot;UIApplication+NetworkActivityIndicatorManager.h&quot;</span></pre>
<p>Then, when you start an asynchronous data connection, call:</p>
<pre class="objc"><span style="color: #002200;">&#91;</span>UIApplication dataOperationStarted<span style="color: #002200;">&#93;</span>;</pre>
<p>Then, in the completion handler or block, simply call:</p>
<pre class="objc"><span style="color: #002200;">&#91;</span>UIApplication dataOperationEnded<span style="color: #002200;">&#93;</span>;</pre>
<p>Also, if you know that all data exchanges are ending (e.g., you're cancelling them as a view is about about to disappear), you can call:</p>
<pre class="objc"><span style="color: #002200;">&#91;</span>UIApplication allDataOperationsEnded<span style="color: #002200;">&#93;</span>;</pre>
<p>It's a simple little category but I hope it helps you in your own apps.</p>
]]></content:encoded>
			<wfw:commentRss>http://aralbalkan.com/3602/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>SFHFKeychainUtils with LLVM (Xcode 3.2.4/iOS 4.1)</title>
		<link>http://aralbalkan.com/3543</link>
		<comments>http://aralbalkan.com/3543#comments</comments>
		<pubDate>Sat, 18 Sep 2010 11:09:24 +0000</pubDate>
		<dc:creator>Aral</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[3.2.4]]></category>
		<category><![CDATA[4.1]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[keychain]]></category>
		<category><![CDATA[llvm]]></category>
		<category><![CDATA[SFHFKeychainUtils]]></category>
		<category><![CDATA[simulator]]></category>
		<category><![CDATA[workaround]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://aralbalkan.com/?p=3543</guid>
		<description><![CDATA[While building with Justin Williams's excellent SFHFKeychainUtils (which makes it easy as pie to work with Keychain on iOS) with Xcode 3.2.4/iOS 4.1 using the LLVM compiler, I got a list of 20-or-so errors. A quick Google search revealed a Stack Overflow thread that appeared to be related in which the prolific Mr. Ben Gottlieb [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />While building with <a href="http://github.com/ldandersen/scifihifi-iphone">Justin Williams's excellent SFHFKeychainUtils</a> (which makes it easy as pie to work with Keychain on iOS) with Xcode 3.2.4/iOS 4.1 using the LLVM compiler, I got a list of 20-or-so errors. A quick Google search revealed <a href="http://stackoverflow.com/questions/719320/scifi-hifi-keychain-problem-seckeychainitemref-undeclared-error">a Stack Overflow thread that appeared to be related</a> in which the prolific Mr. Ben Gottlieb suggests removing </p>
<blockquote><p>any #ifdefs that refer to <code>TARGET_ IPHONE_SIMULATOR</code></p></blockquote>
<p><span id="more-3543"></span></p>
<p>Lo and behold, doing that fixed the errors I was getting too. </p>
<p>Here are my updated <a href="/downloads/SFHFKeychainUtils.zip">SHFHKeychainUtils class</a> (SFHFKeychainUtils.zip, 5KB) in case you're having the same issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://aralbalkan.com/3543/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Demo your iPhone apps via TV-Out</title>
		<link>http://aralbalkan.com/2397</link>
		<comments>http://aralbalkan.com/2397#comments</comments>
		<pubDate>Sun, 04 Oct 2009 18:28:11 +0000</pubDate>
		<dc:creator>Aral</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[a/v]]></category>
		<category><![CDATA[cable]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[mirror]]></category>
		<category><![CDATA[out]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[projector]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[tv]]></category>

		<guid isPermaLink="false">http://aralbalkan.com/2397</guid>
		<description><![CDATA[Demoing iPhone apps during presentations is a bitch because Apple hasn't (yet) given us a way to mirror the screen like Steve Jobs does during his keynotes. The alternatives all suck to various degrees: use a camcorder, an Elmo (the projector, not the Muppet), or the iPhone Simulator. The iPhone Simulator is the easiest option [...]]]></description>
			<content:encoded><![CDATA[<p id="top" /><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/rvGOP87RA7A&hl=en&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/rvGOP87RA7A&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>Demoing iPhone apps during presentations is a bitch because Apple hasn't (yet) given us a way to mirror the screen like Steve Jobs does during his keynotes. The alternatives all suck to various degrees: use a camcorder, an Elmo (the projector, not the Muppet), or the iPhone Simulator. The iPhone Simulator is the easiest option and is fine unless you're trying to demo features only found on the device (like GPS, etc.) or make a demo video of your app being used in the field.</p>
<p><span id="more-2397"></span></p>
<p>Although there isn't an Apple-sanctioned way of mirroring the screen via the Apple A/V cable (apart from for the iPod app), <a href="http://www.touchcentric.com/blog/archives/3" title="TouchCentric &raquo; iPhone App Video Mirroring">Rob Terrell shared some code a little while back that enables TV Out on a per-app basis</a> based on <a href="http://arstechnica.com/apple/news/2008/11/iphone-2-2-sdk-offers-undocumented-tv-out-features.ars" title="iPhone 2.2 SDK offers undocumented TV-out features - Ars Technica">Erica Sadun's discovery of an unpublished class</a> in the MediaPlayer framework. </p>
<p>Rob's class worked like a charm (and still does, under 3.1), however <a href="http://www.theevilboss.com/2009/10/iphone-video-output.html" title="The Evil Boss: iPhone Video Output">The Evil Boss took it one step further today</a> by releasing some <a href="http://www.theevilboss.com/2009/10/iphone-video-output.html" title="The Evil Boss: iPhone Video Output">code that displays touch indicators and rotation changes on the mirrored output</a>. Watch his video, above, and read the full post, <a href="http://www.theevilboss.com/2009/10/iphone-video-output.html" title="The Evil Boss: iPhone Video Output">iPhone Video Output</a>, for the details and to download the code that you can add to your app to enable this functionality.</p>
<p>Just make sure, however, that you don't accidentally submit your app to the App Store with this code enabled or it will probably mean a quick refusal.</p>
<p>Big thanks to both Rob Terrell and The Evil Boss for making this possible. </p>
<p><em>(PS. Apple, if you're listening, please, please, please enable the ability to mirror the iPhone's screen for any app in the next release. Just think of how much the quality of the demo videos for apps will improve and how much that will translate to increased sales. Oh, and why did you remove the private openURL:asPanel: method on UIApplication in 3.0? If we still had that we could actually demo apps that launch Safari for some bit of their functionality via this method.)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://aralbalkan.com/2397/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Mogenerator latest version, 1.13.1 installer, and build instructions.</title>
		<link>http://aralbalkan.com/2268</link>
		<comments>http://aralbalkan.com/2268#comments</comments>
		<pubDate>Mon, 13 Jul 2009 19:59:06 +0000</pubDate>
		<dc:creator>Aral</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Tools and Utilities]]></category>

		<guid isPermaLink="false">http://aralbalkan.com/2268</guid>
		<description><![CDATA[Mogenerator is a very useful utility that creates model classes for you when working with Core Data. I've written about Mogenerator before but what I didn't realize is that I wasn't working with the latest version (the version I was using was 1.6.1 and the latest version as of this writing, compiled from trunk, is [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />Mogenerator is a very useful utility that creates model classes for you when working with Core Data. <a href="http://aralbalkan.com/2152">I've written about Mogenerator before</a> but what I didn't realize is that I wasn't working with the latest version (the version I was using was 1.6.1 and the latest version as of this writing, compiled from trunk, is 1.13.1). </p>
<p>It's easy to get confused as there are several outdated downloads and project pages floating around the web. It appears, however, that <a href="http://github.com/rentzsch/mogenerator/tree/master" title="rentzsch's mogenerator at master - GitHub">this github repository is where Mogenerator is being actively developed</a>.</p>
<p><span id="more-2268"></span></p>
<p>If you're in a rush, here's the <a href="downloads/mogenerator-1.13.1.dmg">Mogenerator 1.13.1 DMG installer</a> (104KB) I built (only tested on my MBP running OS X 10.5.7). </p>
<p>If you'd rather build your own, here are some simple instructions for building and installing the latest version from trunk:</p>
<ol>
<li>Clone the github repository: <code>git clone git://github.com/rentzsch/mogenerator.git</code></li>
<li>Switch to the installer folder: <code>cd mogenerator/installer</code></li>
<li>Build the installer: <code>./make_installer.command</li>
<li>Run the installer: <code>open build/mogenerator-1.13.1.pkg</code></li>
</ol>
<p>Hope this helps!</p>
<p>PS. By the way, in case you're wondering what changed, I didn't see too much difference. A diff between two generated model classes – albeit simple ones – follows (mind you, the insertInManagedObjectContext: had bitten me before):</p>
<pre class="diff"><span style="color: #440088;"><span style="">6</span>,8d5</span>
<span style="color: #991111;">&lt; @implementation SectionID</span>
<span style="color: #991111;">&lt; @end</span>
<span style="color: #991111;">&lt;</span>
<span style="color: #440088;"><span style="">11</span>,19d7</span>
<span style="color: #991111;">&lt; + <span style="">&#40;</span>id<span style="">&#41;</span>insertInManagedObjectContext:<span style="">&#40;</span>NSManagedObjectContext*<span style="">&#41;</span>moc_ <span style="">&#123;</span></span>
<span style="color: #991111;">&lt; 	return <span style="">&#91;</span>NSEntityDescription insertNewObjectForEntityForName:@&quot;Section&quot; inManagedObjectContext:moc_<span style="">&#93;</span>;</span>
<span style="color: #991111;">&lt; <span style="">&#125;</span></span>
<span style="color: #991111;">&lt;</span>
<span style="color: #991111;">&lt; - <span style="">&#40;</span>SectionID*<span style="">&#41;</span>objectID <span style="">&#123;</span></span>
<span style="color: #991111;">&lt; 	return <span style="">&#40;</span>SectionID*<span style="">&#41;</span><span style="">&#91;</span>super objectID<span style="">&#93;</span>;</span>
<span style="color: #991111;">&lt; <span style="">&#125;</span></span>
<span style="color: #991111;">&lt;</span>
<span style="color: #991111;">&lt;</span>
<span style="color: #440088;"><span style="">195</span>,196d182</span>
<span style="color: #991111;">&lt;</span>
&nbsp;</pre>
<p>Update: Hmm, and a bunch of 10.5 specific retains in the generated.h:</p>
<pre class="diff">...
<span style="color: #991111;">&lt; #if defined<span style="">&#40;</span>MAC_OS_X_VERSION_10_5<span style="">&#41;</span> &amp;&amp; MAC_OS_X_VERSION_MAX_ALLOWED &gt;= MAC_OS_X_VERSION_10_5</span>
<span style="color: #991111;">&lt; @property <span style="">&#40;</span>retain<span style="">&#41;</span> NSString *rawSource;</span>
<span style="color: #991111;">&lt; #endif</span>
...</pre>
]]></content:encoded>
			<wfw:commentRss>http://aralbalkan.com/2268/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>A lovely little framework called Swiz</title>
		<link>http://aralbalkan.com/1960</link>
		<comments>http://aralbalkan.com/1960#comments</comments>
		<pubDate>Mon, 09 Feb 2009 22:28:39 +0000</pubDate>
		<dc:creator>Aral</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[dependency injection]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[inversion of control]]></category>
		<category><![CDATA[ioc]]></category>
		<category><![CDATA[loose coupling]]></category>
		<category><![CDATA[swiz]]></category>

		<guid isPermaLink="false">http://aralbalkan.com/?p=1960</guid>
		<description><![CDATA[A few days ago I stumbled upon Swiz, which bills itself as the "brutally simple micro-architecture for Rich Internet Application development with Adobe Flex." If the term micro-architecture or the buzzword Rich Internet Application haven't scared you off yet, read on, because it really is a lovely little framework. Swiz is a lightweight framework for [...]]]></description>
			<content:encoded><![CDATA[<p id="top" /><img src="/images/swiz.png" width="290" height="195" alt="Swiz: Inversion of Control/Dependency Injection framework for Flex and ActionScript" style="float:right; margin-left:2em;"></p>
<p>A few days ago I stumbled upon <a href="http://code.google.com/p/swizframework/">Swiz</a>, which bills itself as the "brutally simple micro-architecture for Rich Internet Application development with Adobe Flex." If the term micro-architecture or the buzzword Rich Internet Application haven't scared you off yet, read on, because it really is a lovely little framework.</p>
<p><span id="more-1960"></span></p>
<p><a href="http://code.google.com/p/swizframework/">Swiz</a> is a lightweight framework for Flex (and ActionScript) that lets you separate your business and presentation logic and implement a loosely-coupled event-based architecture in your applications. I've purposefully stayed away from using the terms Inversion of Control (IoC) and Dependency Injection (DI), even though Swiz is, at its core, an IoC framework that lets you carry out DI. The reason? I feel people get too caught up on the fancy names and either get scared off or end up blindly implementing patterns and frameworks without really understanding what they're doing or why they're doing it. Thankfully, Swiz is simple enough that you can actually understand what it does and why it does what it does. And, it doesn't pigeonhole you into a color-by-numbers straitjacket or suffocate you under a mountain of boilerplate code like some other frameworks.</p>
<p>This blog post is not meant to be an introduction to Swiz. For that, read the <a href="http://code.google.com/p/swizframework/wiki/GettingStarted">Getting Started</a> guide, <a href="http://www.onflex.org/ted/2008/09/360flex-sj-2008-introduction-to-swiz.php">watch the introductory video by Swiz creator Chris Scott</a> from his presentation at 360Flex last year, and <a href="http://soenkerohde.com/category/swiz/">read the Swiz posts on Sönke's blog</a> and those on <a href="http://cdscott.blogspot.com/">Chris's blog</a>.</p>
<p>Instead of an introduction, I want to document how I'm using Swiz and the modifications I've made to it in hopes that they might help other developers and possibly spark conversation on future features.</p>
<h3>Open a window, let some AIR in</h3>
<p>(Sorry, I couldn't resist!)</p>
<p>I ran into a couple of issues with Swiz when I finally got the chance to play with it yesterday. First off, I couldn't get the autowiring to work with new Window instances in AIR. Googling around, I found that this was <a href="http://code.google.com/p/swizframework/issues/detail?id=10&can=1">a known issue and that Sönke had already applied a fix</a> in the form of a <code>registerWindow()</code> method that you call before opening your window. The fix, however, didn't work for me without an additional little patch to manually force the autowiring on the Window class itself. So my <code>registerWindow()</code> method ended up looking like this:</p>
<pre class="actionscript"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> registerWindow<span style="color: #66cc66;">&#40;</span>window:IEventDispatcher<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
    window.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ADDED_TO_STAGE</span>, handleAutowireEvent, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
    window.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">REMOVED_FROM_STAGE</span>, handleAutowireEvent, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
    autowire<span style="color: #66cc66;">&#40;</span>window<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre>
<p>With that little change, my new Window instances get autowired correctly. </p>
<h3>Wrrooom, wrrrrooom!</h3>
<p>I also saw that the autowiring code was causing quite a bit of performance slow-down. So I decided that autowiring should be opt-in. I modified the framework so that only classes that have a public <code>autowire</code> property declared are autowired. I usually declare this in my classes like this:</p>
<pre class="actionscript"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> autowire:<span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">true</span>;</pre>
<p>I could have made it so that I used a metadata tag instead but the whole idea was to stay away from the overhead of describeType. (I'm not sure what additional overhead describeType's XML conversion adds on to the internal describeTypeJSON method but I have a feeling it's quite substantial. If so, it would probably be nice to have a method to just return metadata for a given class &mdash; in the spirit of <code>getQualifiedClassName</code> &mdash; to make it more performant to parse metadata at runtime.)</p>
<p>So my <code>handleAutowireEvent()</code> method in the Swiz class looks like this now:</p>
<pre class="actionscript"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> handleAutowireEvent<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">// Autowiring is strictly opt-in for performance/efficiency, and</span>
	<span style="color: #808080; font-style: italic;">// having an explicit flag in the class should make your intent clearer.</span>
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">hasOwnProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;autowire&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		autowire<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre>
<p>Similarly, the <code>handleRemoveEvent()</code> method simplifies to:</p>
<pre class="actionscript"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> handleRemoveEvent<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">hasOwnProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;autowire&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		_beanFactory.<span style="color: #006600;">unwire</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre>
<p>The performance increase has been striking: the overhead of Swiz, with this change, is entirely negligible whereas before I was experiencing a doubling in the initialization time of my app.</p>
<p>In case you make the same changes, you should also update <code>registerWindow()</code> (hey, every cycle counts right? Or something like that!):</p>
<pre class="actionscript"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> registerWindow<span style="color: #66cc66;">&#40;</span>window:Window<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
    window.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ADDED_TO_STAGE</span>, handleAutowireEvent, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
    window.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">REMOVED_FROM_STAGE</span>, handleRemoveEvent, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">// Fire the autowire manually for the window itself.</span>
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>window.<span style="color: #006600;">hasOwnProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;autowire&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		autowire<span style="color: #66cc66;">&#40;</span>window<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre>
<h3>Flex Framework? How about <em>ActionScript and</em> Flex Framework?</h3>
<p>I'm also using Swiz quite differently to how it was originally intended. Originally, you're supposed to declare your beans (beans? What are we Java?) in MXML. I found this unnecessarily limiting. So I declare my beans (or components; since neither ActionScript nor Flash are a type of coffee) in ActionScript. And, although I'm using Swiz on a Flex app currently, I don't see any reason off the top of my head why you couldn't use it in ActionScript-only projects too.</p>
<p>Here's a sample Beans class in ActionScript showing you how it's done:</p>
<pre class="actionscript">package com.<span style="color: #006600;">mydomain</span>.<span style="color: #006600;">myawesomeapp</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">swizframework</span>.<span style="color: #006600;">util</span>.<span style="color: #006600;">BeanLoader</span>;
&nbsp;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">mydomain</span>.<span style="color: #006600;">myawesomeapp</span>.<span style="color: #006600;">SomeController</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">mydomain</span>.<span style="color: #006600;">myawesomeapp</span>.<span style="color: #006600;">SomeService</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Beans <span style="color: #0066CC;">extends</span> BeanLoader
	<span style="color: #66cc66;">&#123;</span>
	        <span style="color: #808080; font-style: italic;">// Simply instantiate and return an instance...</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> someController<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:SomeController <span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">new</span> SomeController<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> messageController<span style="color: #66cc66;">&#40;</span>o:*<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>;
&nbsp;
              <span style="color: #808080; font-style: italic;">// ... or do some configuration beforehand</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> someService<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:SomeService <span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> someService:SomeService = <span style="color: #000000; font-weight: bold;">new</span> SomeService<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			someService.<span style="color: #006600;">configureSomething</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;like&quot;</span>, <span style="color: #ff0000;">&quot;totally&quot;</span>, <span style="color: #ff0000;">&quot;cool&quot;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">return</span> someService;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> twitter<span style="color: #66cc66;">&#40;</span>o:*<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>;
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Beans<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre>
<p>So, basically, what we're doing is mimicking the methods in the ActionScript class that would have been generated from the MXML (or, more precisely, giving Swiz exactly what it's looking for in the <code>BeanLoader</code>, which are <code>readwrite</code> accessors; this is why we need the setter even though it doesn't do anything.)</p>
<p>And, finally, a gotcha that I find myself falling into: Remember to make anything you're going to <code>[Autowire]</code> or <code>[Mediate]</code> <em>public</em>. This means the properties that will receive the class instances and the event handlers. Since you'll be used to automatically making these private, take extra care!</p>
<h3>In closing</h3>
<p><a href="http://code.google.com/p/swizframework/">Swiz</a> is a lovely, lightweight framework that I'm really enjoying working with. It also has a small but active community and some good developers behind it. <a href="http://code.google.com/p/swizframework/">Play around with it</a>, why don't 'cha and let me know what you think of it in the comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://aralbalkan.com/1960/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Google App Engine to get Reasonably Smart competition</title>
		<link>http://aralbalkan.com/1935</link>
		<comments>http://aralbalkan.com/1935#comments</comments>
		<pubDate>Thu, 29 Jan 2009 15:24:50 +0000</pubDate>
		<dc:creator>Aral</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Commentary]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://aralbalkan.com/1935</guid>
		<description><![CDATA[There's an open source cloud solution called Reasonably Smart that uses Git and JavaScript. Two weeks ago, they were bought by Joyent. Cue the emergence of a viable alternative to Google App Engine. I'm interested in seeing the direction that Joyent takes this.]]></description>
			<content:encoded><![CDATA[<p id="top" />There's an open source cloud solution called <a href="http://reasonablysmart.com/" title="Reasonably Smart Platform">Reasonably Smart</a> that uses Git and JavaScript. Two weeks ago, they were bought by <a href="http://www.joyent.com/" title="Joyent: Welcome to Joyent">Joyent</a>. </p>
<p>Cue the emergence of a viable alternative to <a href="http://code.google.com/appengine/" title="Google App Engine - Google Code">Google App Engine</a>. </p>
<p><span id="more-1935"></span></p>
<p>I'm interested in seeing the direction that Joyent takes this.</p>
]]></content:encoded>
			<wfw:commentRss>http://aralbalkan.com/1935/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Gaebar Beta 3 (version 0.3) released</title>
		<link>http://aralbalkan.com/1907</link>
		<comments>http://aralbalkan.com/1907#comments</comments>
		<pubDate>Wed, 21 Jan 2009 13:01:09 +0000</pubDate>
		<dc:creator>Aral</dc:creator>
				<category><![CDATA[App Engine]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://aralbalkan.com/1907</guid>
		<description><![CDATA[I've just tagged Gaebar Beta 3 (version 0.3) in GitHub. This is a bugfix release, with changes almost entirely submitted by or suggested by the community. Thanks go to gumptionthomas, Martin Kleppmann, Tony Andrews, Rafal Jonca, and, of course, Guido van Rossum, for your patches and feedback. Changes in Beta 3 Merged gumptionthomas's pull request [...]]]></description>
			<content:encoded><![CDATA[<p id="top" /><a href="http://github.com/aral/gaebar/tree/0.3" title="aral's gaebar at 0.3 - GitHub"><img src="http://aralbalkan.com/wp-content/uploads/2009/01/gaebar-beta-3-release.jpg" alt="Gaebar Beta 3 Release" height="190" width="295" style="float:right; margin-left:2em;"></a></p>
<p>I've just tagged <a href="http://github.com/aral/gaebar/tree/0.3" title="aral's gaebar at 0.3 - GitHub">Gaebar Beta 3 (version 0.3)</a> in GitHub.</p>
<p><span id="more-1907"></span></p>
<p>This is a bugfix release, with changes almost entirely submitted by or suggested by the community. </p>
<p>Thanks go to gumptionthomas, Martin Kleppmann, Tony Andrews, Rafal Jonca, and, of course, Guido van Rossum, for your patches and feedback.</p>
<h3>Changes in Beta 3</h3>
<ul>
<li>Merged gumptionthomas's pull request (<a href="http://github.com/aral/gaebar/commit/98415f1f988139987b71522e2f97ccd23ba8a68e" title="Commit 98415f1f988139987b71522e2f97ccd23ba8a68e to aral's gaebar - GitHub">commit</a>)
<ul>
<li>Fixed unicode and escape string issues with key_names</li>
<li>Properly reference InternalError as db.InternalError</li>
</ul>
</li>
<li>Applied patch by Martin Kleppmann (<a href="http://github.com/aral/gaebar/commit/7cb964e36c44be0190d1413ad71030a9b916ff63" title="Commit 7cb964e36c44be0190d1413ad71030a9b916ff63 to aral's gaebar - GitHub">commit</a>)</li>
<ul>
<li>Backup doesn't blow up when there are non-backup files/folders in the backups folder. (e.g., if your project uses SVN)</li>
</ul>
<li>Updated the readme.txt based on Guido's feedback (<a href="http://github.com/aral/gaebar/commit/95a4b99c85c9d0724f21627616248bb23922d680" title="Commit 95a4b99c85c9d0724f21627616248bb23922d680 to aral's gaebar - GitHub">commit</a>)</li>
<li>Added note to readme.txt regarding getting more detailed exceptions (thanks to Tony Andrews; <a href="http://github.com/aral/gaebar/commit/5a9d40a0cf77c14b08f2cdcf673ab7bf9ecef42d" title="Commit 5a9d40a0cf77c14b08f2cdcf673ab7bf9ecef42d to aral's gaebar - GitHub">commit</a>).</li>
<li>Applied patch by Rafal Jonca (<a href="http://github.com/aral/gaebar/commit/95ed388f6d871913ca94f4fd37698262d762fbda" title="Commit 95ed388f6d871913ca94f4fd37698262d762fbda to aral's gaebar - GitHub">commit</a>):
<ul>
<li>Key names may now contain unicode</li>
<li>ReferenceProperties can now be created with keys of parents, not just model instances</li>
<li>Now using global datastore's delete, put, and get methods instead of model's</li>
</ul>
</li>
</ul>
<p><a href="http://aralbalkan.com/1784">See the original announcement</a> for a screencast and general information on Gaebar.</p>
<p>Please do keep your feedback coming and, of course, if you have pull requests, patches, or suggestions, please send them my way (and thank you!)</p>
]]></content:encoded>
			<wfw:commentRss>http://aralbalkan.com/1907/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>How to dynamically switch to the Yahoo! Flex Skin at runtime</title>
		<link>http://aralbalkan.com/1887</link>
		<comments>http://aralbalkan.com/1887#comments</comments>
		<pubDate>Wed, 14 Jan 2009 20:33:31 +0000</pubDate>
		<dc:creator>Aral</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tools and Utilities]]></category>

		<guid isPermaLink="false">http://aralbalkan.com/1887</guid>
		<description><![CDATA[The Yahoo! Flex Skin is a lovely minimalist skin by the good folks on Yahoo!'s Flash team. However, it has an issue that you need to work around if you want to load it in dynamically at runtime. It's a simple thing, but I thought I'd document it here in hopes that it will help [...]]]></description>
			<content:encoded><![CDATA[<p id="top" /><a href="http://www.yswfblog.com/blog/2007/12/13/yahoo-and-flex-feel-good-in-your-own-skin/" title="Yahoo! Flash (R) Blog &raquo; Blog Archive &raquo; Yahoo! and Flex: Feel Good In Your Own Skin"><img src="http://aralbalkan.com/wp-content/uploads/2009/01/yahoo-flex-skin.jpg" alt="Yahoo Flex Skin" height="235" width="401" style="float:right; margin-left:2em; margin-bottom:1em; border:1px solid black;"></a></p>
<p>The <a href="http://www.yswfblog.com/blog/2007/12/13/yahoo-and-flex-feel-good-in-your-own-skin/" title="Yahoo! Flash (R) Blog &raquo; Blog Archive &raquo; Yahoo! and Flex: Feel Good In Your Own Skin">Yahoo! Flex Skin</a> is a lovely minimalist skin by the good folks on Yahoo!'s Flash team. However, it has an issue that you need to work around if you want to load it in dynamically at runtime. It's a simple thing, but I thought I'd document it here in hopes that it will help save someone else a few minutes of confusion.</p>
<p><span id="more-1887"></span></p>
<p>To switch to a different skin at runtime in Flex, you use <code>StyleManager. loadStyleDeclarations</code>, which takes a reference to a CSS file compiled into a SWF as its first (and only required) argument. When you look at the source for the Yahoo! Flex Skin, you might be fooled into thinking that the compiled SWF has been supplied for you since there are two files, <em>yflexskin.css</em> and <em>yflexskin.swf</em> in the folder.</p>
<p><em>yflexskin.swf</em>, however, is the SWF that contains the assets referenced in the CSS file.</p>
<p>Since there is already a SWF file with the same name as the CSS file in the folder, Flex does not/can not compile the CSS file (as it would overwrite the existing SWF). This leads to a runtime error complaining that the SWF file cannot be loaded:</p>
<pre>Error: Unable to load style(SWF is not a loadable module)</pre>
<p>Here's the workaround:</p>
<ol>
<li>Rename the asset SWF to something else, like <em>yflexskinassets.swf</em>.</li>
<li>Do a find and replace in <em>yflexskin.css</em> to rename <code>yflexskin.swf</code> to <code>yflexskinassets.swf</code></li>
<li>In Flex Builder, right-click <em>yflexskin.css</em> and select <em>Compile CSS to SWF</em></li>
</ol>
<p>Now, when you want to switch to it at runtime, you can simply:</p>
<pre class="actionscript">StyleManager.<span style="color: #006600;">loadStyleDeclarations</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;yflexskin/yflexskin.swf&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre>
<p>Simple, but may not be initially obvious. Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://aralbalkan.com/1887/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
	</item>
	</channel>
</rss>

