<?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>nulldesign // lars gerckens &#187; iPhone</title>
	<atom:link href="http://www.nulldesign.de/category/iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nulldesign.de</link>
	<description>blog &#38; portfolio</description>
	<lastBuildDate>Mon, 30 Jan 2012 21:39:51 +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>Adobe AIR Native Extensions for iOS, Learnings</title>
		<link>http://www.nulldesign.de/2012/01/22/adobe-air-native-extensions-for-ios-learnings/</link>
		<comments>http://www.nulldesign.de/2012/01/22/adobe-air-native-extensions-for-ios-learnings/#comments</comments>
		<pubDate>Sun, 22 Jan 2012 14:08:26 +0000</pubDate>
		<dc:creator>lars</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Talk]]></category>

		<guid isPermaLink="false">http://www.nulldesign.de/?p=726</guid>
		<description><![CDATA[In my current client project, we&#8217;re developing an AIR application targeted for iOS (Android will follow) and we wanted to make use of some iOS SDK features, so I had to write my first NativeExtension. Developing the Objective C part is pretty straight forward (If you know C++ and Objective C) and so is the &#8230; <a href="http://www.nulldesign.de/2012/01/22/adobe-air-native-extensions-for-ios-learnings/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In my current client project, we&#8217;re developing an AIR application targeted for iOS (Android will follow) and we wanted to make use of some iOS SDK features, so I had to write my first <a href="http://www.adobe.com/devnet/air/native-extensions-for-air.html" target="_blank">NativeExtension</a>. Developing the Objective C part is pretty straight forward (If you know C++ and Objective C) and so is the Actionscript part. There are some good examples and tutorials on the <a href="http://www.adobe.com/devnet/air/native-extensions-for-air.html" target="_blank">Adobe site</a> about all kind of extensions.</p>
<p>The hard part was to get this thing to work. So I just wanted to share my settings here. This might become useful, if you&#8217;re starting to develop your first ANE. I had strange crashes when I packaged the app with my ANE and I couldn&#8217;t figure out what was wrong. The app just crashed everytime I launched it on the device. The crashlog wasn&#8217;t very helpful. After quite a search, I found out, that I didn&#8217;t set an apparently important compiler flag for the LLVM compiler in my XCode project. So, be sure to set:</p>
<p><strong>Enable Linking With Shared Libraries: No</strong></p>
<p>And if you want to get rid of the warnings:</p>
<p><strong>Warnings: Missing Function Prototypes: No</strong></p>
<p>The second part was packaging the ANE correctly. The working command for my case is:</p>
<p><strong>adt -package -target ane MyExtension.ane extension.xml -swc MyExtension.swc -platform iPhone-ARM library.swf libMyNativeExtensionIOS.a</strong></p>
<p>The annoying thing about packaging the ANE is, that after you have built your swc, you have to extract the library.swf out of it (By renaming it to .zip and extracting the swf). So you need both, the swc AND the swf. I didn&#8217;t write an ANT task to do automate the process until now and I don&#8217;t know the reason for this strange step, since the ADT compiler has everything it needs within the swc. Only Adobe knows ;)</p>
<p>Obviously you can not test on the device everytime, because the deployment process to iOS is more or less manual and just takes too long at the moment. I found out, that I could link the ANE as a regular library (SWC) in my Flash Builder project and launch the app on my desktop machine. When the native extension tries to create the context on the desktop machine, it fails and returns null, because it was just built for the iOS platform:</p>
<p><strong>context = ExtensionContext.createExtensionContext(EXTENSION_ID, null);</strong></p>
<p>So I could implement a fallback for the extention when running on the desktop that mocked the behaviour in AS3. To package the application for iOS, I wrote a small ANT task. This way we can easily test on the device and have a fallback, when testing 0n the desktop without writing desktop extensions as well.</p>
<p>So, maybe someone will find this useful&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nulldesign.de/2012/01/22/adobe-air-native-extensions-for-ios-learnings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cocos2D Particle System Sources</title>
		<link>http://www.nulldesign.de/2011/03/21/cocos2d-particle-system-sources/</link>
		<comments>http://www.nulldesign.de/2011/03/21/cocos2d-particle-system-sources/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 20:34:18 +0000</pubDate>
		<dc:creator>lars</dc:creator>
				<category><![CDATA[Cocos2D]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Particles]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.nulldesign.de/?p=504</guid>
		<description><![CDATA[Since I&#8217;m receiving questions about the particle system I used in my FluidToy 2 quite often lately, I thought I just release the sources here. The particle system is based on a CCNode and works similar to the existing Cocos2D particle systems. The main difference is, that you can control the position and velocity of &#8230; <a href="http://www.nulldesign.de/2011/03/21/cocos2d-particle-system-sources/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Since I&#8217;m receiving questions about the particle system I used in my <a href="http://www.nulldesign.de/fluidtoy2/" target="_blank">FluidToy 2</a> quite often lately, I thought I just release the sources here.</p>
<p>The particle system is based on a CCNode and works similar to the existing <a href="http://www.cocos2d-iphone.org/">Cocos2D</a> particle systems. The main difference is, that you can control the position and velocity of each particle. Please note that this system is not very optimized and lacks in flexibility since I just built it for <a href="http://www.nulldesign.de/fluidtoy2/" target="_blank">FluidToy 2</a> and it was never meant to be more general. In other words: The code is a bit dirty! But feel free to play around with it, modify it and make use of it (and let me know what you&#8217;re making out of it).<br/><br/>There are two different systems: The SimpleParticleSystem, which draws points of any size or a point sprite using a texture. The second one is a LineParticleSystem, which will draw line particles. If you initialize the system with a size of 1000, you&#8217;ll have 500 lines, because a line consists out of 2 points (Wow, you never imagined that, did you? ;)). So if you loop through the particles, be sure to move only every second particle, the other one will follow with a small delay.</p>
<p><a href="http://www.nulldesign.de/wp-content/uploads/2011/03/Cocos2DSimpleParticleSystem.zip">Download: Cocos2DSimpleParticleSystem</a></p>
<p>It works like every other CCNode:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">particles <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>SimpleParticleSystem node<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>particles initialize<span style="color: #002200;">:</span> <span style="color: #2400d9;">1000</span> width<span style="color: #002200;">:</span> size.width height<span style="color: #002200;">:</span> size.height<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>particles setTextureByString<span style="color: #002200;">:</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;particle_small.png&quot;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>self addChild<span style="color: #002200;">:</span> particles<span style="color: #002200;">&#93;</span>;
&nbsp;
Loop through particles<span style="color: #002200;">:</span>
&nbsp;
<span style="color: #a61390;">while</span><span style="color: #002200;">&#40;</span>count &lt; particles.particleCount<span style="color: #002200;">&#41;</span>
<span style="color: #002200;">&#123;</span>
   p <span style="color: #002200;">=</span> <span style="color: #002200;">&amp;</span>particleAr<span style="color: #002200;">&#91;</span>count<span style="color: #002200;">&#93;</span>;
   p<span style="color: #002200;">-</span>&gt;dir.x <span style="color: #002200;">+=</span> CCRANDOM_MINUS1_1<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span>;
   p<span style="color: #002200;">-</span>&gt;dir.y <span style="color: #002200;">+=</span> CCRANDOM_MINUS1_1<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span>;
   <span style="color: #002200;">++</span>count;
   ...
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nulldesign.de/2011/03/21/cocos2d-particle-system-sources/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>iPhone App: FluidToy released</title>
		<link>http://www.nulldesign.de/2010/04/11/iphone-app-fluidtoy-released/</link>
		<comments>http://www.nulldesign.de/2010/04/11/iphone-app-fluidtoy-released/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 20:55:45 +0000</pubDate>
		<dc:creator>lars</dc:creator>
				<category><![CDATA[Cocos2D]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[OpenGL]]></category>

		<guid isPermaLink="false">http://www.nulldesign.de/?p=311</guid>
		<description><![CDATA[Good news everyone. My first iPhone App got released to the AppStore: FluidToy, a little toy that turns your device into an interactive fluid simulation and helps you to relax ;). Enjoy:]]></description>
			<content:encoded><![CDATA[<p>Good news everyone. My first iPhone App got released to the AppStore: <a href="http://itunes.apple.com/us/app/fluidtoy/id363572062?mt=8" target="_blank">FluidToy</a>, a little toy that turns your device into an interactive fluid simulation and helps you to relax ;). Enjoy:</p>
<p style="text-align: center;">
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=10532572&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="300" src="http://vimeo.com/moogaloop.swf?clip_id=10532572&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p style="text-align: center;"><a href="http://itunes.apple.com/us/app/fluidtoy/id363572062?mt=8" target="_blank"><img class="size-full wp-image-319 aligncenter" src="http://www.nulldesign.de/wp-content/uploads/2010/04/App_Store_Badge.png" alt="" width="226" height="78" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nulldesign.de/2010/04/11/iphone-app-fluidtoy-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>First steps on the iPhone</title>
		<link>http://www.nulldesign.de/2009/09/23/first-steps-on-the-iphone/</link>
		<comments>http://www.nulldesign.de/2009/09/23/first-steps-on-the-iphone/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 13:36:41 +0000</pubDate>
		<dc:creator>lars</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Talk]]></category>

		<guid isPermaLink="false">http://www.nulldesign.de/?p=265</guid>
		<description><![CDATA[Here are the results of my first tries with ObjectiveC + Cocoa2D + OpenGL. Feels nice and pretty fast and I like the &#8220;strange&#8221; look of the ObjectiveC language. I implemented a small particle system based on a CocosNode with OpenGL, 10000 particles moving with a decent framerate! Second I ported an existing fluid solver &#8230; <a href="http://www.nulldesign.de/2009/09/23/first-steps-on-the-iphone/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here are the results of my first tries with ObjectiveC + Cocoa2D + OpenGL. Feels nice and pretty fast and I like the &#8220;strange&#8221; look of the ObjectiveC language. I implemented a small particle system based on a CocosNode with OpenGL, 10000 particles moving with a decent framerate! Second I ported an existing fluid solver to ObjectiveC, there is a lot to optimize, that&#8217;s why it&#8217;s running only at 30 fps. I like experimenting with this platform, more to come&#8230;</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="227" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=6715220&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="227" src="http://vimeo.com/moogaloop.swf?clip_id=6715220&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nulldesign.de/2009/09/23/first-steps-on-the-iphone/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

