<?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>Funky Visions</title>
	<atom:link href="http://funkyvisions.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://funkyvisions.com/blog</link>
	<description>Funky Visions</description>
	<lastBuildDate>Sun, 15 Apr 2012 10:00:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Multi-Target: The Guide</title>
		<link>http://funkyvisions.com/blog/2012/04/multi-target-the-guide/</link>
		<comments>http://funkyvisions.com/blog/2012/04/multi-target-the-guide/#comments</comments>
		<pubDate>Sun, 15 Apr 2012 10:00:56 +0000</pubDate>
		<dc:creator>Doug</dc:creator>
				<category><![CDATA[idevblogaday]]></category>

		<guid isPermaLink="false">http://funkyvisions.com/blog/?p=1979</guid>
		<description><![CDATA[In a previous blog entry I had mentioned that I combined my Full and Lite versions of each of my apps into one XCode project using targets.  This was something that pre-XCode 4 was pretty hard to do, thus my decision to keep them as separate projects until recently. Another reason to create multiple targets [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://funkyvisions.com/blog/2012/01/multi-target/">a previous blog entry</a> I had mentioned that I combined my Full and Lite versions of each of my apps into one XCode project using targets.  This was something that pre-XCode 4 was pretty hard to do, thus my decision to keep them as separate projects until recently.</p>
<p>Another reason to create multiple targets would be to keep your iPhone and iPad versions in the same project.  This probably becomes even more important nowadays if you don’t wish to go the Universal App route and prevent retina assets app bloat.  Plus it gives you the option of pricing your iPad app differently than your iPhone app if you choose to do so.</p>
<p>I didn’t go into much detail the previous time around other than to give a few quick pointers.  This time I’ve created a sample project and will guide you through step-by-step with screen captures where appropriate.  The project <a href="http://funkyvisions.com/blog/wp-content/uploads/2012/04/MultiTarget.zip">can be found here</a> (you’ll need it because I’m not going to go through every single step in this tutorial).</p>
<p>The first thing I did was create a new “Single View” project.</p>
<p style="text-align: center;"><a href="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt1.png"><img class="aligncenter size-full wp-image-1980" title="mt1" src="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt1.png" alt="" width="500" /></a></p>
<p>This created a target with the same name as the project.</p>
<p style="text-align: center;"><a href="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt2.png"><img class="aligncenter size-full wp-image-1981" title="mt2" src="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt2.png" alt="" width="500" /></a></p>
<p>I really wanted to create 2 targets with different names than the project.  So I created 2 new “Single View Application” targets (File-&gt;New-&gt;Target).  The first one I called MultiTargetIphone and the second MultiTargetIpad, making sure to select the right “Device Family” for both.</p>
<p style="text-align: center;"><a href="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt3.png"><img class="aligncenter size-full wp-image-1984" title="mt3" src="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt3.png" alt="" width="500" /></a></p>
<p>I then removed the original MultiTarget target, scheme, and directory.  You do this by selecting Product-&gt;Manage Schemes.  Click the minus sign to remove MultiTarget.  Then select the target in the TARGET view, right click, and delete.  Also remove it from the files view and the physical directory in the project (show in finder).  If anyone has a better way to remove a target and all it’s files, let me know.  It seems like a lot of areas to remove.</p>
<p>Here’s what my project looked like after this step</p>
<p style="text-align: center;"><a href="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt4.png"><img class="aligncenter size-full wp-image-1985" title="mt4" src="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt4.png" alt="" width="400" /></a></p>
<p>And in Finder</p>
<p style="text-align: center;"><a href="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt5.png"><img class="aligncenter size-full wp-image-1986" title="mt5" src="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt5.png" alt="" width="400" /></a></p>
<p>To prove that these are indeed 2 different targets and binaries I’m going to add some shared code and assets as well as specific target code and assets.  When we’re done we’ll examine the resulting bundles and make sure only the necessary assets are included.  When adding files and assets make sure you specify what target they should be included in.</p>
<p style="text-align: center;"><a href="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt6.png"><img class="aligncenter size-full wp-image-1987" title="mt6" src="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt6.png" alt="" width="400" /></a></p>
<p>or you can do this after the fact in the File Inspector panel</p>
<p style="text-align: center;"><a href="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt7.png"><img class="aligncenter size-full wp-image-1988" title="mt7" src="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt7.png" alt="" width="300" /></a></p>
<p>In this example I’m using a separate XIB file per target.  I’m going to put 2 buttons in each.  One button will call a target specific IBAction and the other will call an IBAction that will use a shared class to perform it’s behavior.  Both targets include SharedStuff.m and shared.png, however they each have their own ViewController that handles the specific behaviors for that target as well as their own button images (ipad.png and iphone.png).</p>
<p>The one thing I did notice is that Interface Builder doesn’t seem to honor the “Target Membership” settings.  That is, when I’m editing the XIB for the iPad it allows me to select iphone.png as the background button image even though I only added that file to the iPhone target.  The button DOES end up empty as expected when you run the executable (because the png file is not included in the bundle), but just be aware interface builder may be showing you things it shouldn’t (let me know if you have a different understanding of this).</p>
<p>I’m not going to go into the details of wiring up the IBActions, building the UI, or writing the code in the action.  You have the source and can play around with that.  Here’s what my project structure now looks like.</p>
<p style="text-align: center;"><a href="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt8.png"><img class="aligncenter size-full wp-image-1990" title="mt8" src="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt8.png" alt="" width="300" /></a></p>
<p>My directory structure in Finder looks like this</p>
<p style="text-align: center;"><a href="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt9.png"><img class="aligncenter size-full wp-image-1991" title="mt9" src="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt9.png" alt="" width="400" /></a></p>
<p>You’ll notice I also added icon.png and icon-72.png for both the iPhone and iPad.  You can select the icon to use in the target’s summary panel</p>
<p style="text-align: center;"><a href="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt10.png"><img class="aligncenter size-full wp-image-1992" title="mt10" src="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt10.png" alt="" width="400" /></a></p>
<p>Ok, now let’s run the 2 targets.  First select the iPad one and run it on the iPad simulator.</p>
<p style="text-align: center;"><a href="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt11.png"><img class="aligncenter size-full wp-image-1993" title="mt11" src="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt11.png" alt="" width="400" /></a></p>
<p>You’ll see the following</p>
<p style="text-align: center;"><a href="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt12.png"><img class="aligncenter size-full wp-image-1994" title="mt12" src="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt12.png" alt="" width="400" /></a></p>
<p>The top button is using ipad.png to display it’s contents.  The bottom button is using shared.png.  Clicking on each will call the appropriate IBAction in the ViewController and display an alert dialog.  The shared one will use SharedStuff which is common code (and asset) shared by both targets.</p>
<p>Now let’s run the iPhone one in the iPad simulator to prove that they are indeed 2 different binaries.  You’ll know this because the iPhone version will run in 1x mode and not take up the full screen.</p>
<p style="text-align: center;"><a href="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt13.png"><img class="aligncenter size-full wp-image-1996" title="mt13" src="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt13.png" alt="" width="400" /></a></p>
<p style="text-align: center;"><a href="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt14.png"><img class="aligncenter size-full wp-image-1997" title="mt14" src="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt14.png" alt="" width="400" /></a></p>
<p>You’ll also notice two different icons on the SpringBoard.</p>
<p style="text-align: center;"><a href="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt15.png"><img class="aligncenter size-full wp-image-1998" title="mt15" src="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt15.png" alt="" width="300" /></a></p>
<p>Ok, but how do you know the bundles only include what is necessary for each platform?  One way is to look at the “Build Phases”.</p>
<p style="text-align: center;"><a href="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt16.png"><img class="aligncenter size-full wp-image-1999" title="mt16" src="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt16.png" alt="" width="500" /></a></p>
<p>Notice that the iPad target includes it’s version of main.m, AppDelegate.m, and ViewController.m, and includes the shared SharedStuff.m.  But it doesn’t reference any of the code files for the iPhone target.  In the resources it has it’s own InfoPlist.strings, ViewController.xib, and ipad.png, and shares shared.png, but doesn’t reference iphone.png or it’s interface builder files.</p>
<p>Another option is to build for the device and use <a href="http://www.ecamm.com/mac/phoneview/">PhoneView</a> to inspect the package contents.</p>
<p style="text-align: center;"><a href="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt17.png"><img class="aligncenter size-full wp-image-2001" title="mt17" src="http://funkyvisions.com/blog/wp-content/uploads/2012/04/mt17.png" alt="" width="500" /></a></p>
<p>You don’t see any of the iPhone assets in the iPad bundle.</p>
<p>Whew&#8230; I hope that helps understanding how to build an iOS app that can target multiple devices separately and yet share common assets.  Or you might use it to provide full and lite versions of your app.  You’d just add a LITE_VERSION compiler flag to the build settings for your lite version and ifdef your code accordingly.</p>
<p>There really is no reason not to try and combine different versions of your app into one project now that Apple has made it easy.  While this use to be hard before XCode 4 it’s obvious Apple has given this considerable thought since then.</p>
<p>UPDATE: Last weekend I submitted <a href="http://funkyvisions.com/index.html">Jiggle Balls Studio</a> to Apple.  It&#8217;s the update to Jiggle Balls HD that is now FREE and supports In-App Purchases.  I&#8217;m still waiting for it to be approved, but in the meantime you can go get the <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=384846111&amp;mt=8">previous version for FREE</a> and get yourself ready for the update.  Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://funkyvisions.com/blog/2012/04/multi-target-the-guide/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Common Sensor</title>
		<link>http://funkyvisions.com/blog/2012/04/common-sensor/</link>
		<comments>http://funkyvisions.com/blog/2012/04/common-sensor/#comments</comments>
		<pubDate>Sun, 01 Apr 2012 20:46:23 +0000</pubDate>
		<dc:creator>Doug</dc:creator>
				<category><![CDATA[idevblogaday]]></category>

		<guid isPermaLink="false">http://funkyvisions.com/blog/?p=1971</guid>
		<description><![CDATA[Today is a status update along with some helpful Box2D hints.  I&#8217;ve spent the last week working on finishing the new themes and gadgets that will be available via In-App purchases in Jiggle Balls Studio (formerly known as Jiggle Balls HD).  One of the things I was most challenged with was how I was going [...]]]></description>
			<content:encoded><![CDATA[<p>Today is a status update along with some helpful Box2D hints.  I&#8217;ve spent the last week working on finishing the new themes and gadgets that will be available via In-App purchases in Jiggle Balls Studio (formerly known as Jiggle Balls HD).  One of the things I was most challenged with was how I was going to do the magnets.  I wanted them to attract all the balls within the magnetic field.  Initially I put out a call to my Facebook buddies asking the following:</p>
<p><a href="http://funkyvisions.com/blog/wp-content/uploads/2012/04/beam.jpg"><img class="aligncenter size-medium wp-image-1972" title="beam" src="http://funkyvisions.com/blog/wp-content/uploads/2012/04/beam-300x283.jpg" alt="" width="300" height="283" /></a></p>
<blockquote><p>Ok math gurus. Need your help. I need to know when a ball gets in the magnetic field (blue) of the magnet. I know the middle coordinates of the magnet (it&#8217;s really just a circle underneath) and the angle it is rotated. The magnetic field is drawn relative to the magnet. I know the balls coordinates and diameter. I just need to know if the center coordinates of the ball fall within the coordinates I need calculated for the magnetic field. I don&#8217;t really care about the small angles in the beam, just treat it like a rectangle. Got it?</p></blockquote>
<p>As I started thinking about it I realized that Box2D could do this for me.  BTW&#8230; I humbly believe that Box2D is one of the most useful opensource projects out there.  Without it I don&#8217;t think many of the iPhone games that exist (including Angry Birds) would have been created by the indie developer.  So anyway&#8230; ya&#8230; I remember something I did in Tramp Stamp to detect when the ball fell within a region.  The only difference here is that I needed to have that region attached to the magnet and rotate with it.  Well&#8230; it turns out this was REALLY easy.  I just added another shape to my body and marked it as a sensor.  Sensors don&#8217;t act as normal fixtures.  That is they don&#8217;t collide with other fixtures or affect the overall behavior of the body.  Wallah!  I now easily had a way to detect when the magnetic beam intersected a ball.</p>
<p>You can see this in effect in the follow demo video I&#8217;ve posted.</p>
<p><a href="http://www.youtube.com/watch?v=_ooID97ZqPM"><img src="http://img.youtube.com/vi/_ooID97ZqPM/2.jpg"></a></p>
<p><a href="http://www.youtube.com/watch?v=_ooID97ZqPM">Click here</a> to view the video on YouTube.</p>

<p>Hope that helps someone out there.  It&#8217;s amazing the things Box2D can do for you when you model things appropriately.  I&#8217;m just about done with Jiggle Balls Studio.  I&#8217;m hoping that it will be released before the end of April.  Then I&#8217;ll get back to my game I abandoned a year ago.</p>
]]></content:encoded>
			<wfw:commentRss>http://funkyvisions.com/blog/2012/04/common-sensor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cruise, Crap, and Finding Time</title>
		<link>http://funkyvisions.com/blog/2012/03/cruise-crap-and-finding-time/</link>
		<comments>http://funkyvisions.com/blog/2012/03/cruise-crap-and-finding-time/#comments</comments>
		<pubDate>Sun, 18 Mar 2012 15:15:08 +0000</pubDate>
		<dc:creator>Doug</dc:creator>
				<category><![CDATA[idevblogaday]]></category>

		<guid isPermaLink="false">http://funkyvisions.com/blog/?p=1969</guid>
		<description><![CDATA[Today&#8217;s entry is a status update.  I missed last time around because I had just gotten back from a Bahama cruise with Donny &#38; Marie (please don&#8217;t laugh &#8212; it was a dream of my girlfriend).  If you&#8217;re curious about it you can read it on my personal blog here.  It was relaxing and got [...]]]></description>
			<content:encoded><![CDATA[<p>Today&#8217;s entry is a status update.  I missed last time around because I had just gotten back from a Bahama cruise with <a href="http://donnyandmariecruise.com/">Donny &amp; Marie</a> (please don&#8217;t laugh &#8212; it was a dream of my girlfriend).  If you&#8217;re curious about it you can read it on <a href="http://dougdavies.net/2012/03/04/donny-marie-cruise/">my personal blog here</a>.  It was relaxing and got me away from my electronic devices for 5 days.  I&#8217;d forgotten how much I like to curl up with a good book in the sun.  And my girlfriend enjoyed the D&amp;M activities.</p>
<p>I also have an update to my <a href="http://funkyvisions.com/blog/2012/01/1942/">Who Makes All This Crap</a> blog entry from a few weeks ago.  Apparently some of this was made up <a href="http://tech.fortune.cnn.com/2012/03/18/apple-and-the-daisey-affair/?hpt=hp_t3">according to a recent article</a> stating that Daisey embellished many of the facts.  There is still an issue and I think Apple has acknowledged it and I truly believe they are doing what is in their power to correct the situation.  It&#8217;s still profound to me that so many of our electronics are handmade.  Even though machines are manufacturing the components, you don&#8217;t stop to think of someone having to assemble all those tiny components together.  It&#8217;s just too bad those jobs couldn&#8217;t be done in America.</p>
<p>And lastly&#8230; work continues on putting <a href="http://funkyvisions.com/blog/2012/02/store-age-making-my-app-free/">In-App purchases</a> into Jiggle Balls HD (now titled Jiggle Balls Studio).  The store front is completely done and I&#8217;m working on the content for two products.  One is a new theme (and others will be easy to add once the framework is done) and another is a new obstacle&#8230; magnets!  I&#8217;m hoping for a May release.  At that time I will have completed all the maintenance work I wanted to do across my product lines and will get back to <a href="http://funkyvisions.com/blog/2011/06/a-work-in-progress/">my game I started over a year ago</a>.  My thought process about that game has changed as the landscape of the app store has changed, so it will need to go through a bit of rework as well as being IAP enabled (all of which I can lift easily from the work I&#8217;ve done on JBS).</p>
<p>I still struggle with finding time (or more specifically making time) to work on my iOS projects.  I&#8217;m lucky if I get 5 hours of work squeezed in a week.  At that rate it&#8217;s really hard to get something to market.  As I&#8217;ve said in the past&#8230; sometimes I&#8217;d love to ditch the day job and do this full-time, but currently I don&#8217;t feel like I could take that risk (mostly for health insurance reasons to tell ya the truth).  I&#8217;m envious of those who have taken the plunge.</p>
<p>Sorry this was so short this week.  I still owe you an entry about multi-targeted builds.  Perhaps next time when I can get some screenshots together.  Thanks for reading.</p>
]]></content:encoded>
			<wfw:commentRss>http://funkyvisions.com/blog/2012/03/cruise-crap-and-finding-time/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Store Age: Making My App Free</title>
		<link>http://funkyvisions.com/blog/2012/02/store-age-making-my-app-free/</link>
		<comments>http://funkyvisions.com/blog/2012/02/store-age-making-my-app-free/#comments</comments>
		<pubDate>Tue, 21 Feb 2012 00:46:42 +0000</pubDate>
		<dc:creator>Doug</dc:creator>
				<category><![CDATA[idevblogaday]]></category>

		<guid isPermaLink="false">http://funkyvisions.com/blog/?p=1960</guid>
		<description><![CDATA[I&#8217;ve taken a hiatus from working on my current game.  The last few months I&#8217;ve been updating all my apps.  Removing OpenFeint, going Game Center exclusively (see my DDGameKitHelper entry), changing the minimum requirements to iOS4.2, and removing PlayHaven from all my apps and replacing it with my own cross-pomotion UI (I smell a blog entry [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve taken a hiatus from working on my current game.  The last few months I&#8217;ve been updating all my apps.  Removing OpenFeint, going Game Center exclusively (see my <a href="http://funkyvisions.com/blog/2011/12/synchronizing-game-center-achievements-and-scores/">DDGameKitHelper</a> entry), changing the minimum requirements to iOS4.2, and removing <a href="http://www.playhaven.com/">PlayHaven</a> from all my apps and replacing it with my own cross-pomotion UI (I smell a blog entry on this one).  My sales have not suffered because of any of these decisions.  Finally I&#8217;m to my last app, <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=384846111&amp;mt=8">Jiggle Balls HD</a> for the iPad.  I&#8217;ve decided to make it free (and remove the Lite version).  I&#8217;ve avoided freemium for as long as I can.  I&#8217;m ready to jump on the bandwagon.  And I think this app is the right one to do it with.  Why?  Because the freemium model fits it really well.  I can sell updated themes (new balls, backgrounds, and sounds) as well as new obstacles (bombs, blackholes, magnets, etc.)</p>
<p>Last weekend I got my in-app framework completed using <a href="http://www.raywenderlich.com/2797/introduction-to-in-app-purchases">Ray Wenderlich&#8217;s excellent blog post</a> (thanks Ray!).  I&#8217;ve started implementing the store UI now.  The trouble I&#8217;m having is whether to include a BUY button inline with a disabled item (probably Apple doesn&#8217;t like this) or to just have a store-front that list all available items.  My app uses <a href="https://developer.apple.com/library/ios/#documentation/uikit/reference/UIPopoverController_class/Reference/Reference.html">UIPopoverControllers</a> quite extensively.  So right now I&#8217;ve gone with the latter approach and the store is completely contained under one popover.</p>
<p><a href="http://funkyvisions.com/blog/wp-content/uploads/2012/02/IMG_0185.png"><img class="aligncenter size-full wp-image-1962" title="IMG_0185" src="http://funkyvisions.com/blog/wp-content/uploads/2012/02/IMG_0185.png" alt="" width="451" height="537" /></a></p>
<p>It shows all available purchases and whether they&#8217;ve been installed yet or the availability price (formatted for locale).  If the products could not be retrieved or there is no network connection then the button will show unavailable (so at least they are aware there are items for sale).  I&#8217;ve also include the restore purchases button here for convenience.  I plan to have this done (1 theme and 1 obstacle) within the month and get back to my never-ending game, which will also be freemium, although I&#8217;m having a harder time coming up with stuff to sell on that one.</p>
<p>BTW&#8230; I know I&#8217;m a day late with this post, but that&#8217;s the beauty of this new format.  I&#8217;m glad for that.  Next week I&#8217;m taking a much earned vacation and taking a cruise down to the Bahamas.  I&#8217;ll be getting back the day my next entry is due, so I&#8217;ll probably be running a bit late on it as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://funkyvisions.com/blog/2012/02/store-age-making-my-app-free/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Ethical Developer</title>
		<link>http://funkyvisions.com/blog/2012/02/the-ethical-developer/</link>
		<comments>http://funkyvisions.com/blog/2012/02/the-ethical-developer/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 11:00:57 +0000</pubDate>
		<dc:creator>Doug</dc:creator>
				<category><![CDATA[idevblogaday]]></category>

		<guid isPermaLink="false">http://funkyvisions.com/blog/?p=1949</guid>
		<description><![CDATA[By now you all know about the Temple Jump fiasco this week.  If not, read this excellent article.  I followed the drama for 24 hours on twitter while @kshepherd and @nattylux of Imangi (Temple Run) worked with Apple to get it removed (and ultimately all his other clones). The developer in question is Anton Sinelnikov.  His website [...]]]></description>
			<content:encoded><![CDATA[<p>By now you all know about the Temple Jump fiasco this week.  If not, read <a href="http://www.guardian.co.uk/technology/appsblog/2012/feb/03/apps-apple?newsfeed=true">this excellent article</a>.  I followed the drama for 24 hours on twitter while <a href="https://twitter.com/#!/kshepherd">@kshepherd</a> and <a href="https://twitter.com/#!/nattylux">@nattylux</a> of <a href="http://www.imangistudios.com/">Imangi</a> (<a href="http://itunes.apple.com/us/app/temple-run/id420009108?mt=8">Temple Run</a>) worked with Apple to get it removed (and ultimately all his other clones).</p>
<p>The developer in question is Anton Sinelnikov.  His website link from the app store takes you <a href="http://www.sinelnikov.com/">here</a> (some of his links take you directly to his gmail address).  This website gets you to his <a href="https://www.facebook.com/sinelnikov">Facebook page</a> and his <a href="https://plus.google.com/112363927722447839841/posts">Google+ page</a>.  The question is, is this a real person or a facade for some bigger developer sweat shop?  I didn&#8217;t download any of his games, so I&#8217;m imagining none of them were of any quality or even resembled the app they pretended to be.  However the facade in the app store gave the appearance of high quality.  That is, the icon and the one single app image looked legit and would lead the casual buyer to fall for buying it (if they didn&#8217;t bother to check all the horrible reviews or 1 star ratings).  UPDATE: Since writing this entry I&#8217;ve seen several <a href="http://www.youtube.com/watch?v=rbllEX4XcTE">youtube posts</a> of the game play.  Seems pretty basic and rudimentary.</p>
<p>I am truly amazed that there could have been enough purchases of this game to drive it up to the number 1 spot on the pay list.  I question whether this person or organization had also figured out how to game the system.  Did this many people really fall for an app that cost $1 when the real version is freemium (or maybe we just don&#8217;t understand Apple&#8217;s ranking algorithm)?  How many thousands of other deceptable apps have not been discovered because they&#8217;ve never gotten ranked?  How many consumers have been taken advantage of thinking they were buying one thing and got something else.</p>
<p>There&#8217;s also the whole <a href="http://itunes.apple.com/us/app/tiny-tower/id422667065?mt=8">Tiny Tower</a> and Zynga (Dream Heights) + Skyboard (Pixel Story) controversy.  The difference here isn&#8217;t that those companies are trying to deceive the consumer however.  They&#8217;re just out and out copying a successful product by a much smaller company than them.  <a href="http://nimblebit.com/">NimbleBit</a> should rightfully be concerned (and probably a little bit flattered) that someone has copied their idea.  Luckily they got recognized by Apple and have probably already made millions, but that doesn&#8217;t make it right that someone can come along and copy so easily.</p>
<p>How does a developer stoop this low?  I think with many Indies that ethics plays a very important part in our development process.  We know what it takes to develop something and we are respectful (and sometimes in awe) of what others have done.  I pride myself that all my apps have been original.  I don&#8217;t download a lot of games for that very reason.  So if I do copy something it&#8217;s totally unintentional.  But so far I&#8217;m pretty sure I&#8217;m the <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=345201722&amp;mt=8">original trampoline game</a> in the app store and if anyone ever copies me I would want to complain to Apple as well (although would they listen to someone who hasn&#8217;t been quite as successful?).  Certainly this developer knew he was being deceiving.  Certainly he knew at some point he would be discovered.  I always feel bad when I get a review where the consumer didn&#8217;t think they got their money&#8217;s worth (even on free apps &#8212; go figure).  How does this guy feel about all his 1 star reviews?  I doubt very bad.  I imagine his business ethics carry over to his personal life.  And this makes this guy a snake oil salesman.  Not a developer.  We don&#8217;t want him in our community tainting the consumers taste for our products.  While I don&#8217;t care for Zynga either, at least they build something reputable and in some people&#8217;s opinion&#8230; fun.</p>
<p>It was fantastic to see an indie triumph in the app store this week and have Apple recognize the violation.  Let&#8217;s all stay vocal and clean-up the app store so that we and the consumer can enjoy a safe and fun place to play!</p>
<p>Oh&#8230; and GO &lt;insert your favorite super bowl team here&gt;!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://funkyvisions.com/blog/2012/02/the-ethical-developer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Who Makes All This Crap?</title>
		<link>http://funkyvisions.com/blog/2012/01/1942/</link>
		<comments>http://funkyvisions.com/blog/2012/01/1942/#comments</comments>
		<pubDate>Sun, 22 Jan 2012 11:00:24 +0000</pubDate>
		<dc:creator>Doug</dc:creator>
				<category><![CDATA[idevblogaday]]></category>

		<guid isPermaLink="false">http://funkyvisions.com/blog/?p=1942</guid>
		<description><![CDATA[I was gonna followup this week on my previous entry with more details on how to do multi-target (which turns out by the way to be extremely easy &#8212; but I&#8217;ll probably document it anyway in a future entry).  But then a friend of mine sent me this link to a &#8220;This American Life&#8221; podcast [...]]]></description>
			<content:encoded><![CDATA[<p>I was gonna followup this week on my previous entry with more details on how to do multi-target (which turns out by the way to be extremely easy &#8212; but I&#8217;ll probably document it anyway in a future entry).  But then a friend of mine sent me this <a href="http://www.thisamericanlife.org/radio-archives/episode/454/mr-daisey-and-the-apple-factory">link to a &#8220;This American Life&#8221; podcast episode</a> about how and where Apple products are made.  I think it&#8217;s a <span style="text-decoration: underline;">must listen</span> for every developer.  Much like the comedian in the story, I had this impression that robots were used to do much of the work.  Instead he states that more things are hand-made now than in any other time in history.  I will warn that it&#8217;s a bit depressing, but swings towards a happier ending with the hope that conditions are improving and the workers are given a voice.</p>
<p>I think it&#8217;s important that developers not only be knowledgeable about technology but also about the human side of things.  Knowing how to program is one thing.  Knowing how to captivate your audience is something else completely.  I&#8217;m posting the link to this podcast not to discourage, but to educate.  Hopefully Apple is as transparent as they claim to be and they are actively working to improve the conditions.  If they are not, I think we as developers could have some influence on that if we chose to.</p>
<p>So the next time you launch one of your apps on your device, think about how &#8220;magical&#8221; it is.  And think about the poor guy who lost the use of his hand making it for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://funkyvisions.com/blog/2012/01/1942/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Multi-Target</title>
		<link>http://funkyvisions.com/blog/2012/01/multi-target/</link>
		<comments>http://funkyvisions.com/blog/2012/01/multi-target/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 05:00:17 +0000</pubDate>
		<dc:creator>Doug</dc:creator>
				<category><![CDATA[idevblogaday]]></category>

		<guid isPermaLink="false">http://funkyvisions.com/blog/?p=1923</guid>
		<description><![CDATA[I&#8217;m not as methodical and organized with my iPhone development as I am at my day job.  My version control system is Time Machine, I have PNG images scattered all over my desktop, and up until recently I was maintaining separate projects for my full and lite versions of each product.  Why?  Probably a bit [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not as methodical and organized with my iPhone development as I am at my day job.  My version control system is Time Machine, I have PNG images scattered all over my desktop, and up until recently I was maintaining separate projects for my full and lite versions of each product.  Why?  Probably a bit of laziness and probably a bit of not thinking the time investment was worth the payoff.  It&#8217;s quite possible this was a little more difficult to do in Xcode 3 as well, but I never attempted it.</p>
<p>So while I was gutting Tramp Stamp to remove OpenFeint and go Game Center exclusively, I decided to merge the projects.  The first thing I did was launch FileMerge to compare the 2 projects and see what I was dealing with.  If you haven&#8217;t used it, it&#8217;s probably one of the most useful hidden tools on my Mac next to Automator.  The comparison showed only a handful of files and images were different.</p>
<p>The next thing I did was duplicate my target and change the PRODUCT NAME.  Then I added a define (LITE_VERSION) to the compiler options.  I then merged the source files that had differences using #ifdef to handle the two streams of logic.  I then added _lite to all the relevant image names and changed/split any code that referenced them.  Wallah!  A few hours later and I had both projects running and merged into 1 more manageable project.</p>
<p>I did run across one problem where the simulator refused to launch the lite version.  It would crash in main telling me that the app was already running.  A little searching and I found out that a reboot would fix it (I had already tried to kill zombie processes).  Sure enough it did.  Seems to be attributed to the way the process ends some times.  If I use the stop debug button, it seems to be better than shutting down the app from the simulator.</p>
<p>I am now doing the same with my other 3 apps.  Up until this point my build settings had been intermixed between the project and target ones.  Now I&#8217;m understanding the target settings a lot better and can change the appropriate ones.  This probably won&#8217;t make me any more money or give me any more exposure in the app store, but somehow this gives me satisfaction and makes the thought off adding any future enhancements a whole lot more palatable.</p>
<p>Ok&#8230; now I really should get busy on my never-ending project.  See ya next time!</p>
]]></content:encoded>
			<wfw:commentRss>http://funkyvisions.com/blog/2012/01/multi-target/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Synchronizing Offline Game Center Achievements and Scores</title>
		<link>http://funkyvisions.com/blog/2011/12/synchronizing-game-center-achievements-and-scores/</link>
		<comments>http://funkyvisions.com/blog/2011/12/synchronizing-game-center-achievements-and-scores/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 05:00:12 +0000</pubDate>
		<dc:creator>Doug</dc:creator>
				<category><![CDATA[idevblogaday]]></category>

		<guid isPermaLink="false">http://funkyvisions.com/blog/?p=1892</guid>
		<description><![CDATA[Last post I was talking about removing OpenFeint and using Steffen Itterheim&#8217;s GameKitHelper class. As I started testing I came across many issues on my 4.x devices. It didn&#8217;t have anything to do with his library, but more to do with the inconsistent error reporting on many of the Game Center callbacks when the device [...]]]></description>
			<content:encoded><![CDATA[<p>Last post I was talking about removing OpenFeint and using <a href="http://www.learn-cocos2d.com">Steffen Itterheim&#8217;s GameKitHelper</a> class. As I started testing I came across many issues on my 4.x devices. It didn&#8217;t have anything to do with his library, but more to do with the inconsistent error reporting on many of the Game Center callbacks when the device was offline.  Thus I would get inconsistent caching and notifications on the game center server.  After struggling for 2 days I decided I was going to rewrite the module and take a different approach.</p>
<p>So <a href="https://github.com/csddavies/DDGameKitHelper">DDGameKitHelper</a> was born.  My version keeps a permanent local cache of all achievements earned and each category&#8217;s best score achieved.  Then anytime Game Center comes back online I synch between my local cache and Game Center, filling in the missing pieces on both sides.  I never remove anything from my local cache.   So if an achievement is reported on game center but not locally, I re-cache it. If it&#8217;s local but not in game center, I report it. This allows a fresh install of the app to automatically get all achievements and scores the first time it starts up.</p>
<p>Steffen&#8217;s class was also trying to write to the root bundle directory.  While this works in the simulator it did not work for me on the device.  So I moved the cache files to the /Library directory.  His version did not cache scores either. DDGameKitHelper keeps track of the high score in each category. So even though it reports the score each time (so that daily and weekly comparisons work), it&#8217;s only cached locally if the high score has been beat (you can provide your own compare method in the delegate).</p>
<p>DDGameKitHelper only deals with achievements and scores. Since none of my games use multiplayer I didn&#8217;t try to tackle an API for that. I also have not tackled someone else signing in to game center. Right now I think everything locally would synch with the new account, which really isn&#8217;t what you want neccessarily. So I will be working on a cache per user in future versions. (UPDATE: I&#8217;ve implemented multiple game center player caching)</p>
<p>The DDGameKitHelperDelegate class is dependent on Benjamin Borowski&#8217;s GKAchievementNotification class.</p>
<p><a href="https://github.com/typeoneerror/GKAchievementNotification">https://github.com/typeoneerror/GKAchievementNotification</a></p>
<p>It does an excellent job of display a slide down notification that fits in seamlessly with game center.</p>
<p>You should be able to drop the <a href="https://github.com/csddavies/DDGameKitHelper">DDGameKitHelper</a> and <a href="https://github.com/typeoneerror/GKAchievementNotification">GKAchievementNotification</a> files into your project.   BTW&#8230; I know all of this functionality is available in iOS 5.x, but I want to still support my 4.x users.</p>
<p>The API is as follows.</p>
<p><span style="text-decoration: underline;">Authenticating a player</span></p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>DDGameKitHelper sharedGameKitHelper<span style="color: #002200;">&#93;</span> authenticateLocalPlayer<span style="color: #002200;">&#93;</span>;</pre></div></div>

<p><span style="text-decoration: underline;">Unlocking an achievement</span></p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>DDGameKitHelper sharedGameKitHelper<span style="color: #002200;">&#93;</span> reportAchievement<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;1&quot;</span> percentComplete<span style="color: #002200;">:</span><span style="color: #2400d9;">100</span><span style="color: #002200;">&#93;</span>;</pre></div></div>

<p><span style="text-decoration: underline;">Reporting a score</span></p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>DDGameKitHelper sharedGameKitHelper<span style="color: #002200;">&#93;</span> submitScore<span style="color: #002200;">:</span>newscore category<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;1&quot;</span><span style="color: #002200;">&#93;</span>;</pre></div></div>

<p><em>IMHO think you should always report every score and let game center decided if it beat the previous score, thus daily and weekly will work properly.  DDGameKitHelper will only cache the score locally if it meets the criteria of your compare delegate method (see below).</em></p>
<p><span style="text-decoration: underline;">Showing achievements</span></p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>DDGameKitHelper sharedGameKitHelper<span style="color: #002200;">&#93;</span> showAchievements<span style="color: #002200;">&#93;</span>;</pre></div></div>

<p><span style="text-decoration: underline;">Showing scores</span></p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>DDGameKitHelper sharedGameKitHelper<span style="color: #002200;">&#93;</span> showLeaderboard<span style="color: #002200;">&#93;</span>;</pre></div></div>

<p><span style="text-decoration: underline;">Resetting achievements</span></p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>DDGameKitHelper sharedGameKitHelper<span style="color: #002200;">&#93;</span> resetAchievements<span style="color: #002200;">&#93;</span>;</pre></div></div>

<p><em>This is useful during testing, but you may actually want this functionality in your game as well.</em></p>
<p>The following delegate methods should be implemented.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span>bool<span style="color: #002200;">&#41;</span> compare<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>int64_t<span style="color: #002200;">&#41;</span>score1 to<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>int64_t<span style="color: #002200;">&#41;</span>score2
<span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">return</span> score1 &gt; score2;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> onSubmitScore<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>int64_t<span style="color: #002200;">&#41;</span>score;
<span style="color: #002200;">&#123;</span>
    <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>GKAchievementHandler defaultHandler<span style="color: #002200;">&#93;</span> notifyAchievementTitle<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;New High Score!!!&quot;</span> andMessage<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSString</span> stringWithFormat<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;%d&quot;</span>, score<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> onReportAchievement<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>GKAchievement<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>achievement
<span style="color: #002200;">&#123;</span>
    DDGameKitHelper<span style="color: #002200;">*</span> gkHelper <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>DDGameKitHelper sharedGameKitHelper<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>GKAchievementHandler defaultHandler<span style="color: #002200;">&#93;</span> notifyAchievement<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>gkHelper getAchievementDescription<span style="color: #002200;">:</span>achievement.identifier<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>As stated earlier, your compare method should following the sort order of your leader board. The other 2 methods use the GKAchievementHandler class to show a banner.  If you are going to use this on an iPad you may want to add an adjustFrame method to compensate for the different dimensions.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #a61390;">BOOL</span> isPad<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span> 
<span style="color: #002200;">&#123;</span>
   <span style="color: #6e371a;">#ifdef UI_USER_INTERFACE_IDIOM</span>
      <span style="color: #a61390;">return</span> <span style="color: #002200;">&#40;</span>UI_USER_INTERFACE_IDIOM<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">==</span> UIUserInterfaceIdiomPad<span style="color: #002200;">&#41;</span>;
   <span style="color: #6e371a;">#else</span>
      <span style="color: #a61390;">return</span> <span style="color: #a61390;">NO</span>;
   <span style="color: #6e371a;">#endif</span>
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span>CGRect<span style="color: #002200;">&#41;</span>adjustFrame<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CGRect<span style="color: #002200;">&#41;</span>frame
<span style="color: #002200;">&#123;</span>
   <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>isPad<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>
      <span style="color: #a61390;">return</span> CGRectMake<span style="color: #002200;">&#40;</span>frame.origin.x <span style="color: #002200;">+</span> <span style="color: #2400d9;">242</span>, frame.origin.y, frame.size.width, frame.size.height<span style="color: #002200;">&#41;</span>;
   <span style="color: #a61390;">else</span>
      <span style="color: #a61390;">return</span> frame;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>And then use it when the frame is set.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">self.frame <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>self adjustFrame<span style="color: #002200;">:</span>kGKAchievementFrameStart<span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>I&#8217;ve submitted an update to <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=345201722&amp;mt=8">Tramp Stamp</a> using this new logic (UPDATE: it got approved before the Dec. 22nd cutoff &#8212; so go check it out).  I also bumped my app requirements from iOS 3.1.3 to 4.2.  I&#8217;ll have to do analysis as to whether this was the right decision or not.  BTW&#8230; does anyone know what the user experience is for those still on 3.x?  Will they just not see the update?</p>
<p>I&#8217;ve put all this code up on <a href="https://github.com/csddavies">GitHub</a>.  It uses the MIT License, so you are free to use this however you&#8217;d like.  In fact, I&#8217;d appreciate feedback and any bugs/enhancements you make to it.</p>
<p><a href="https://github.com/csddavies/DDGameKitHelper">https://github.com/csddavies/DDGameKitHelper</a></p>
<p>Oh&#8230; and Happy Holidays!  I hope it&#8217;s a good one for all us indys, but I suspect we&#8217;ll be buried under a blanket of EA apps.</p>
]]></content:encoded>
			<wfw:commentRss>http://funkyvisions.com/blog/2011/12/synchronizing-game-center-achievements-and-scores/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Text Me Apple!</title>
		<link>http://funkyvisions.com/blog/2011/12/text-me-apple/</link>
		<comments>http://funkyvisions.com/blog/2011/12/text-me-apple/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 14:59:11 +0000</pubDate>
		<dc:creator>Doug</dc:creator>
				<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://funkyvisions.com/blog/?p=1911</guid>
		<description><![CDATA[A couple of years ago I got tired of constantly checking my email for app approvals.  I thought&#8230; wouldn&#8217;t it be great if I could get notified via a text message (sms)?  Then I remembered gmail has filters.  So I set one up for the approval notices that come through from Apple.  Here&#8217;s how to [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of years ago I got tired of constantly checking my email for app approvals.  I thought&#8230; wouldn&#8217;t it be great if I could get notified via a text message (sms)?  Then I remembered gmail has filters.  So I set one up for the approval notices that come through from Apple.  Here&#8217;s how to do it if you are interested and have a gmail address registered as your notification email.</p>
<p>Go into setting in gmail.</p>
<p><a href="http://funkyvisions.com/blog/wp-content/uploads/2011/12/settings.png"><img class="aligncenter size-full wp-image-1912" title="settings" src="http://funkyvisions.com/blog/wp-content/uploads/2011/12/settings.png" alt="" width="278" height="357" /></a></p>
<p>Select Filters.</p>
<p><a href="http://funkyvisions.com/blog/wp-content/uploads/2011/12/filters1.png"><img class="aligncenter size-full wp-image-1917" title="filters" src="http://funkyvisions.com/blog/wp-content/uploads/2011/12/filters1.png" alt="" width="408" height="235" /></a></p>
<p>Create a new filter.</p>
<p><a href="http://funkyvisions.com/blog/wp-content/uploads/2011/12/create1.png"><img class="aligncenter size-full wp-image-1914" title="create1" src="http://funkyvisions.com/blog/wp-content/uploads/2011/12/create1.png" alt="" width="354" height="423" /></a></p>
<p>And then tell it what sms address to send to (you&#8217;ll have to check with your provider for this).  For me it&#8217;s the phone number at vtext.com.</p>
<p><a href="http://funkyvisions.com/blog/wp-content/uploads/2011/12/create2.png"><img class="aligncenter size-full wp-image-1915" title="create2" src="http://funkyvisions.com/blog/wp-content/uploads/2011/12/create2.png" alt="" width="347" height="472" /></a></p>
<p>Sit back and relax.  Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://funkyvisions.com/blog/2011/12/text-me-apple/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ain&#8217;t Using Feint</title>
		<link>http://funkyvisions.com/blog/2011/12/aint-using-feint/</link>
		<comments>http://funkyvisions.com/blog/2011/12/aint-using-feint/#comments</comments>
		<pubDate>Sun, 11 Dec 2011 14:00:39 +0000</pubDate>
		<dc:creator>Doug</dc:creator>
				<category><![CDATA[idevblogaday]]></category>

		<guid isPermaLink="false">http://funkyvisions.com/blog/?p=1864</guid>
		<description><![CDATA[I took a sidetrack from my current project this week to remove OpenFeint from Tramp Stamp.  I personally am not getting any benefit from the service anymore and I really wanted to trim the game down.  This turned out to be a little more painful than I anticipated.  Mostly because this was an old project [...]]]></description>
			<content:encoded><![CDATA[<p>I took a sidetrack from my current project this week to remove OpenFeint from <a href="http://funkyvisions.com/index3.html">Tramp Stamp</a>.  I personally am not getting any benefit from the service anymore and I really wanted to trim the game down.  This turned out to be a little more painful than I anticipated.  Mostly because this was an old project that hadn&#8217;t seen Xcode 4 before.  It took me several hours to even get it to build and run in the simulator, let alone start stripping out OpenFeint.  The Xcode 4 fiasco could be a whole separate blog entry at some point.</p>
<p>My basic needs were to have offline handling of Game Center scores and achievements as well as notifications for achievements.  I know that iOS 5 handles both of these, but I still want to target my 4.1 audience.  So after a few discussion on Twitter with @funnest, @GavinBowman, and @mike3k I found <a href="http://s50.codeinspot.com/q/2087559">this article</a> that worked for getting basic Game Center functionality into my App using <a href="http://www.learn-cocos2d.com/">Steffan Itterheim&#8217;s</a> GameKitHelper class.  I had Game Center functionality via OpenFeint, so it was just a matter of finding the 3 places (initialization, achievement reporting, and score reporting) that I called OpenFeint and replacing them with calls to this class.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">// initialize</span>
GameKitHelper <span style="color: #002200;">*</span>gkHelper <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>GameKitHelper sharedGameKitHelper<span style="color: #002200;">&#93;</span>;
gkHelper.delegate <span style="color: #002200;">=</span> self;
<span style="color: #002200;">&#91;</span>gkHelper authenticateLocalPlayer<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #11740a; font-style: italic;">// unlock achievement</span>
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>unlockAchievement<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSString</span><span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>achievementStr
<span style="color: #002200;">&#123;</span>
   GameKitHelper <span style="color: #002200;">*</span>gkHelper <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>GameKitHelper sharedGameKitHelper<span style="color: #002200;">&#93;</span>;
   <span style="color: #002200;">&#91;</span>gkHelper reportAchievementWithID<span style="color: #002200;">:</span>achievementStr percentComplete<span style="color: #002200;">:</span><span style="color: #2400d9;">100</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">// report score</span>
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>newHighScore<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span><span style="color: #002200;">&#41;</span>newscore
<span style="color: #002200;">&#123;</span>
   GameKitHelper <span style="color: #002200;">*</span>gkHelper <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>GameKitHelper sharedGameKitHelper<span style="color: #002200;">&#93;</span>;
   <span style="color: #002200;">&#91;</span>gkHelper submitScore<span style="color: #002200;">:</span>newscore category<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;1&quot;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>

<p>I also wanted the achievement notification system like OpenFeint did.  So I found this <a href="http://www.typeoneerror.com/articles/post/game-center-achievement-notification">GKAchievementHandler library</a> to help me out.  It&#8217;s easy to use and tied in nicely to the GameKitHelperDelegate methods.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> onAchievementReported<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>GKAchievement<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>achievement
<span style="color: #002200;">&#123;</span>
   CCLOG<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;onAchievementReported: %@&quot;</span>, achievement<span style="color: #002200;">&#41;</span>;
   GameKitHelper<span style="color: #002200;">*</span> gkHelper <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>GameKitHelper sharedGameKitHelper<span style="color: #002200;">&#93;</span>;
   <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>GKAchievementHandler defaultHandler<span style="color: #002200;">&#93;</span> notifyAchievement<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>gkHelper getAchievementDescriptionByID<span style="color: #002200;">:</span>achievement.identifier<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>

<p>I created the loadAchievementDescriptions and getAchievementDescriptionById methods to make it easier to display the achievement message.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> loadAchievementDescriptions
<span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>isGameCenterAvailable <span style="color: #002200;">==</span> <span style="color: #a61390;">NO</span><span style="color: #002200;">&#41;</span>
        <span style="color: #a61390;">return</span>;
&nbsp;
    achievementDescriptions <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSMutableDictionary</span> alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>GKAchievementDescription loadAchievementDescriptionsWithCompletionHandler<span style="color: #002200;">:^</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSArray</span> <span style="color: #002200;">*</span>descriptions, <span style="color: #400080;">NSError</span> <span style="color: #002200;">*</span>error<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
        <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>error <span style="color: #002200;">!=</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
            NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Error getting achievement descriptions: %@&quot;</span>, error<span style="color: #002200;">&#41;</span>;
        <span style="color: #002200;">&#125;</span>
&nbsp;
        <span style="color: #a61390;">for</span> <span style="color: #002200;">&#40;</span>GKAchievementDescription <span style="color: #002200;">*</span>achievementDescription <span style="color: #a61390;">in</span> descriptions<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
            <span style="color: #002200;">&#91;</span>achievementDescriptions setObject<span style="color: #002200;">:</span>achievementDescription forKey<span style="color: #002200;">:</span>achievementDescription.identifier<span style="color: #002200;">&#93;</span>;
        <span style="color: #002200;">&#125;</span>
    <span style="color: #002200;">&#125;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span>GKAchievementDescription<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> getAchievementDescriptionByID<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSString</span><span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>identifier
<span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>isGameCenterAvailable <span style="color: #002200;">==</span> <span style="color: #a61390;">NO</span><span style="color: #002200;">&#41;</span>
        <span style="color: #a61390;">return</span> <span style="color: #a61390;">nil</span>;
&nbsp;
    GKAchievementDescription<span style="color: #002200;">*</span> description <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>achievementDescriptions objectForKey<span style="color: #002200;">:</span>identifier<span style="color: #002200;">&#93;</span>;
    <span style="color: #a61390;">return</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>description retain<span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>

<p>Combining the 2 libraries together I was able to get the functionality I wanted and removed about 2MB from my binary.  Now I&#8217;m working on redesigning the appstore icon.  Everything looks great at 512&#215;512.  It&#8217;s a science finding one that scales down nicely to 57&#215;57.  So hopefully I&#8217;ll get a Tramp Stamp update submitted this week.  A bit more testing to do, but I&#8217;m happy with the Game Center implementation.</p>
<p>UPDATE: It seems to be working fairly well, although I&#8217;m having a few issues with offline.  If I turn wifi off on my iPod Touch and run the game, the achievement banners get displayed, however nothing shows up in the achievement screen and when I turn wifi back on and rerun the app (no multi-tasking on the iPod), nothing gets submitted.  What&#8217;s strange is that reportAchievementWithCompletionHandler completes with an error of nil (no error), which I wouldn&#8217;t expect with no internet connection. Any ideas appreciated.  I also noticed the code does not support offline scores, although I see someone has submitted a patch to Steffan.</p>
<p>UPDATE #2: The reportAchievementWithCompletionHandler only seemed to happen on 4.2.1 devices and only if this wasn&#8217;t the first debug session in Xcode (yes, I know weird).  Once I got past that I noticed there was an issue with writing the cache file.  It was trying to put it in the root directory.  I was getting an &#8220;deny file-write&#8221; on the</p>
<p>[NSKeyedArchiver archiveRootObject:cachedAchievements toFile:file];</p>
<p>call.  Once I changed that to append &#8220;Documents&#8221; then the cache file got written and when I enabled wifi it reported the achievement successfully.  So&#8230; I think I&#8217;m almost ready to submit.</p>
]]></content:encoded>
			<wfw:commentRss>http://funkyvisions.com/blog/2011/12/aint-using-feint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

