<?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>iPhone Dev Resource &#187; Objective C</title>
	<atom:link href="http://www.iphonedevresource.com/category/objective-c/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iphonedevresource.com</link>
	<description>[i canHas:info];</description>
	<lastBuildDate>Thu, 01 Apr 2010 12:41:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>iPhone Game Collaboration Experiment</title>
		<link>http://www.iphonedevresource.com/2009/05/iphone-game-collaboration-experiment/</link>
		<comments>http://www.iphonedevresource.com/2009/05/iphone-game-collaboration-experiment/#comments</comments>
		<pubDate>Sat, 09 May 2009 08:50:55 +0000</pubDate>
		<dc:creator>J.Seuss</dc:creator>
				<category><![CDATA[App Store]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[Collaboration]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Game Programming]]></category>
		<category><![CDATA[Objective C]]></category>
		<category><![CDATA[Promo Codes]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPod Touch]]></category>
		<category><![CDATA[iTunes]]></category>

		<guid isPermaLink="false">http://www.iphonedevresource.com/?p=43</guid>
		<description><![CDATA[Well, if you haven&#8217;t already guessed, I&#8217;m the Founder and Lead Software Engineer of JSeuss Software (http://iphone.jseuss.com). After the success of some of my recent projects (Pegs in Space for example) and given our game engine has reached a certain level of maturity, it&#8217;s time to go that extra yard. 
That&#8217;s why I&#8217;m trying out something [...]]]></description>
			<content:encoded><![CDATA[<p>Well, if you haven&#8217;t already guessed, I&#8217;m the Founder and Lead Software Engineer of JSeuss Software (<a href="http://iphone.jseuss.com">http://iphone.jseuss.com</a>). After the success of some of my recent projects (<a href="http://iphone.jseuss.com/PegsInSpace.html">Pegs in Space</a> for example) and given our game engine has reached a certain level of maturity, it&#8217;s time to go that extra yard. </p>
<p>That&#8217;s why I&#8217;m trying out something different.  I&#8217;ve always liked isometric turn based games (XCom &#8211; UFO: Enemy Unknown being the classic) and now I&#8217;ve got some resources at my fingertips, I&#8217;m getting the team to put together an isometric strategy game made primarily for the iPhone.  But here&#8217;s the different part &#8211; I don&#8217;t want to develop this game in secret until the end.  I think it&#8217;s important to show what kind of things go on behind the scenes and to allow players to give feedback early and often.  And I&#8217;ll be letting some parts be totally influenced by the fans.</p>
<p>To start it off, a name has to be chosen for the new game.  All submissions welcome. Head over to <a href="http://game.jseuss.com">http://game.jseuss.com/</a> for more info -it&#8217;ll be up soon.  The person who comes up with the winning name will get an App Store Promo Code for Pegs In Space, and also for the new game once it&#8217;s released.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iphonedevresource.com/2009/05/iphone-game-collaboration-experiment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optimizing Objective C for iPhone</title>
		<link>http://www.iphonedevresource.com/2008/11/optimizing-objective-c-for-iphone/</link>
		<comments>http://www.iphonedevresource.com/2008/11/optimizing-objective-c-for-iphone/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 10:19:24 +0000</pubDate>
		<dc:creator>J.Seuss</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Objective C]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPod Touch]]></category>

		<guid isPermaLink="false">http://www.iphonedevresource.com/?p=17</guid>
		<description><![CDATA[
There are so many apps out there for the iPhone that are doing some pretty graphics/algorithmically intensive stuff.  Most are right on the money when it comes to responsiveness, but some are just woeful!    
Perhaps it&#8217;s the promises of fame and fortune that seems synonymous with iPhone programming, but many developers new to Objective [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>There are so many apps out there for the iPhone that are doing some pretty graphics/algorithmically intensive stuff.  Most are right on the money when it comes to responsiveness, but some are just woeful!    </p>
<p>Perhaps it&#8217;s the promises of fame and fortune that seems synonymous with iPhone programming, but many developers new to Objective C are doing straight ports or just writing plain ObjC code until their app &#8216;works&#8217; then just release it.  There seems to be a feeling that if an app is slow, the device just can&#8217;t handle it.  </p>
<p>I&#8217;ve been stepping through the hoops of (relatively) computationally heavy apps at the moment with the creation of a generic physics engine for use in a bunch of 2D based games.  Because it was my first app with serious algorithms in it, I didn&#8217;t give optimization much thought. And if you believe most &#8216;Good Software Practice&#8221; guidelines, that was a good thing. (optimize last, or you&#8217;ll be optimizing things that need no optimization at all.)</p>
<p>But perhaps some thought is necessary.  At the beginning, it&#8217;s very nice to go down the path of using pure ObjC throughout your code.  Let&#8217;s face it &#8211; it has a nice set of design features that make you feel like you&#8217;re on a fluffy cloud rather than the hard stainless steel bench of C.  And if you&#8217;re particularly sick like me, [you setLovesSquareBrackets:YES]. But of course the nice features of ObjC come at a cost, and the biggest one is the passing of messages.  C/C++ programmers often forget that when invoking a method on an object in ObjC, you are actually passing a message to the object which has to be converted into a function call at runtime.  Great for flexible, extendable libraries &#8211; bad for speed.</p>
<p>So you can either start your development with core components using plain C calls, or you can do what I did and wait until the &#8216;end&#8217; and use the profiler.  The &#8216;Instruments&#8217; tool in conjunction with remote iPhone SDK debugging is great.  You can actually run the app on the device and get statistics about what you&#8217;re app is doing and when &#8211; without a huge penalty to performance.  </p>
<p>Take a typical recording and keep an eye out for the msg_send call, and how much time is spent there.  You may actually find that you&#8217;ve introduced a dependency lock that&#8217;s slowing things down or you may have an update timer that&#8217;s just being ridiculous and updating a billion times a second. </p>
<p>But if you find out that a lot of time is spent calling msg_send, all hope is not lost.  You can still do some optimizations that help out.  For the other things I&#8217;ll talk about them later. </p>
<p>In simple cases, you do some of the internal work of ObjC yourself and cut out the middle man (sourced from <a href="http://www.cs.helsinki.fi/u/ekarttun/objc/">here</a>):</p>
<pre>-naive {
  for(i=0; i&lt;50000000; i++)
    [obj hello];
}

-optimised {
  typedef id (*hello_t)(id, SEL, ...);
  hello_t ref = [obj methodFor:@selector(hello)];
  for(i=0; i&lt;500000000UL; i++)
    ref(obj,@selector(hello));
} </pre>
<p>which will work in a lot of cases.</p>
<p>But sometimes, you just have to revert to C.  Go back to the profiler and see what&#8217;s happening.  If there are still a lot of msg_send calls clogging up your execution time, then you&#8217;ll have to strip out the offenders and just write C functions.  It&#8217;s really not that bad..</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.iphonedevresource.com/2008/11/optimizing-objective-c-for-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

