<?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>I ticked the wrong box &#187; mobile development</title>
	<atom:link href="http://hamishrickerby.com/category/mobile-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://hamishrickerby.com</link>
	<description>Computer says...</description>
	<lastBuildDate>Fri, 23 Jul 2010 07:46:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>iPhone &amp; iPad (iOS) Localizations and Regions</title>
		<link>http://hamishrickerby.com/2010/07/23/iphone-ipad-localizations-regions/</link>
		<comments>http://hamishrickerby.com/2010/07/23/iphone-ipad-localizations-regions/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 07:45:12 +0000</pubDate>
		<dc:creator>Hamish Rickerby</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mobile development]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://hamishrickerby.com/?p=454</guid>
		<description><![CDATA[Recently I have been doing some localizations of an iOS app from English (US) to English (UK). The iPhone development guides from Apple describe how to support multiple languages (such as English, German, Japanese), but fail to describe how to support multiple variants of a single language. By this I mean support support for US [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have been doing some localizations of an iOS app from English (US) to English (UK). The iPhone development guides from Apple describe how to support multiple languages (such as English, German, Japanese), but fail to describe how to support multiple variants of a single language. By this I mean support support for US English, English, NZ English, AU English. The word I needed to regionalize was Behavior (or Behaviour, depending where you come from). </p>
<p>In the Apple Developer Library, it explicitly states that for MacOS applications take both the Language and Regional preferences of the user into account, but only look at the preferred <em>language</em> on iOS &#8211; <a href="http://developer.apple.com/iphone/library/documentation/MacOSX/Conceptual/BPInternational/Articles/InternatSupport.html">Support for Internationalization</a>.  This means that a single variant <em>per language</em> is supported. </p>
<p>However, these is a way around this. I&#8217;m not sure if this is a <em>good</em> thing to do, but it works for me and I haven&#8217;t noticed any ill side effects yet.</p>
<p>To support both US English and British English in your iOS application, create 2x Localization.strings files just as you would for multiple language. Put the US English translation file Localization.strings in a directory in your iPhone app called English.lproj (Apple defaults) and the British English translation in a directory named en_GB.lproj (just in case they decide to support regions in the future).</p>
<p>Then, you&#8217;ll need to create some code to manually set the preferred localization.  In your main.m file (yup, main.m is being edited) alter it so it performs some logic similar to below.</p>
<pre class="brush: objc;">
int main(int argc, char *argv[]) {
	NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
	NSString *language = [[NSLocale preferredLanguages] objectAtIndex:0];
	NSString *locale = [[NSLocale currentLocale] objectForKey: NSLocaleCountryCode];
	if ([language isEqualToString:@&quot;en&quot;] &amp;&amp; [locale isEqualToString:@&quot;GB&quot;]) {
		[[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObjects:@&quot;en_GB&quot;, @&quot;en&quot;, nil] forKey:@&quot;AppleLanguages&quot;];
	}
	int retVal = UIApplicationMain(argc, argv, nil, nil);
	[pool release];
	return retVal;
}
</pre>
<p>When the line </p>
<pre class="brush: objc;">
int retVal = UIApplicationMain(argc, argv, nil, nil);
</pre>
<p>gets executed, it seems to set up all the Localization bundles before calling the application:didFinishLaunchingWithOptions method on your app delegate, so putting Localization code in the app delegate is too late. So, what the code above does is retrieve the users current language and region, and compares those against pre-determined values &#8211; en for the language and gb for the region. If these match, then I force a new setting in the NSUserDefaults to overwrite the users preferred language. Then, when the UIApplicationManager function gets called, it appears to retrieve the users preferred language setting, and look up the Localization for that &#8211; which in my case I&#8217;ve forced to be en_GB.</p>
<p>One thing you need to be careful about is persistence of this NSUserDefault setting.  It is saved once it&#8217;s set, and persists through multiple application executions. To get around this (lets say the user changes their region back to US), you need to remove the setting after the bundle initialization has taken place.  In you app delegates application:didFinishLaunchingWithOptions method, just execute the following code.</p>
<pre class="brush: objc;">
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@&quot;AppleLanguages&quot;];
</pre>
<p>This wipes out the NSUserDefault setting that the app made in the main.m file.</p>
<p>If anyone knows of issues with this approach (apart from being a dirty hack), or faults with my code please let me know in the comments below. I wish Apple supported different regions per language natively in iOS but they don&#8217;t. This is the only way I&#8217;ve found to do this, and continue to use localization functions such as NSLocalizedString.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-2696058307997556";
/* 468x60, created 29/07/09 */
google_ad_slot = "3174546356";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://hamishrickerby.com/2010/07/23/iphone-ipad-localizations-regions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving Van</title>
		<link>http://hamishrickerby.com/2010/03/04/moving-van/</link>
		<comments>http://hamishrickerby.com/2010/03/04/moving-van/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 07:35:59 +0000</pubDate>
		<dc:creator>Hamish Rickerby</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mobile development]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://hamishrickerby.com/?p=445</guid>
		<description><![CDATA[Yesterday when I came home Moving Van&#8217;s sales were up. I was a bit surprised as I hadn&#8217;t done any specific marketing for the app, and what was really odd is that they were only up for the UK. A little investigation and I discover that Moving Van has been featured as &#8220;New and Noteworthy&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday when I came home <a href="http://is.gd/93SaG">Moving Van&#8217;s</a> sales were up. I was a bit surprised as I hadn&#8217;t done any specific marketing for the app, and what was really odd is that they were only up for the UK.  A little investigation and I discover that <a href="http://is.gd/93SaG">Moving Van</a> has been featured as &#8220;New and Noteworthy&#8221; in the iTunes Store UK.</p>
<p><a href="http://hamishrickerby.com/wp-content/uploads/2010/03/Screen-shot-2010-03-03-at-17.52.49.png" rel="lightbox[445]"><img src="http://hamishrickerby.com/wp-content/uploads/2010/03/Screen-shot-2010-03-03-at-17.52.49-300x142.png" alt="Moving Van in the iTunes Store" title="Moving Van as New and Noteworthy" width="300" height="142" class="aligncenter size-medium wp-image-444" /></a></p>
<p>How frickin&#8217; exciting!</p>
]]></content:encoded>
			<wfw:commentRss>http://hamishrickerby.com/2010/03/04/moving-van/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculate age in objective-c</title>
		<link>http://hamishrickerby.com/2010/01/07/calculate-age-in-objective-c/</link>
		<comments>http://hamishrickerby.com/2010/01/07/calculate-age-in-objective-c/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 19:30:13 +0000</pubDate>
		<dc:creator>Hamish Rickerby</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mobile development]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://hamishrickerby.com/?p=432</guid>
		<description><![CDATA[For an iPhone application I&#8217;m developing for a client I need to capture the birthdate of a user, and then show their age on a profile screen. I went looking for a function to help with this simple and tedious task, but couldn&#8217;t find any example code that could be lifted to help me, so [...]]]></description>
			<content:encoded><![CDATA[<p>For an iPhone application I&#8217;m developing for a client I need to capture the birthdate of a user, and then show their age on a profile screen. I went looking for a function to help with this simple and tedious task, but couldn&#8217;t find any example code that could be lifted to help me, so I rolled my own.  Here is what I made, steal as you see fit.</p>
<pre class="brush: objc;">
- (NSInteger)age:(NSDate *)dateOfBirth {
  NSCalendar *calendar = [NSCalendar currentCalendar];
  unsigned unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit;
  NSDateComponents *dateComponentsNow = [calendar components:unitFlags fromDate:[NSDate date]];
  NSDateComponents *dateComponentsBirth = [calendar components:unitFlags fromDate:dateOfBirth];

  if (([dateComponentsNow month] &lt; [dateComponentsBirth month]) ||
      (([dateComponentsNow month] == [dateComponentsBirth month]) &amp;&amp; ([dateComponentsNow day] &lt; [dateComponentsBirth day]))) {
    return [dateComponentsNow year] - [dateComponentsBirth year] - 1;
  } else {
    return [dateComponentsNow year] - [dateComponentsBirth year];
  }
}
</pre>
<p><script type="text/javascript"><!--
google_ad_client = "pub-2696058307997556";
/* 468x60, created 29/07/09 */
google_ad_slot = "3174546356";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://hamishrickerby.com/2010/01/07/calculate-age-in-objective-c/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>iPhone Camera Overlays + iphonearkit</title>
		<link>http://hamishrickerby.com/2009/09/20/iphone-camera-overlays-iphonearkit/</link>
		<comments>http://hamishrickerby.com/2009/09/20/iphone-camera-overlays-iphonearkit/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 16:58:33 +0000</pubDate>
		<dc:creator>Hamish Rickerby</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[augmented reality]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mobile development]]></category>

		<guid isPermaLink="false">http://hamishrickerby.com/?p=424</guid>
		<description><![CDATA[Today I have been hacking away on the iphonearkit source available at github and have incorporated the ARGeoViewController as an overlay over a ImagePickerController with the camera as the source (which was introduced with iPhone OS 3.1).  Results below. I want to tidy up some of the code before I check it back into my [...]]]></description>
			<content:encoded><![CDATA[<p>Today I have been hacking away on the <a href="http://github.com/zac/iphonearkit" target="_self">iphonearkit source</a> available at github and have incorporated the ARGeoViewController as an overlay over a ImagePickerController with the camera as the source (which was introduced with iPhone OS 3.1).  Results below.</p>
<div id="attachment_425" class="wp-caption aligncenter" style="width: 310px"><a href="http://hamishrickerby.com/wp-content/uploads/2009/09/IMG_0337.PNG" rel="lightbox[424]"><img class="size-medium wp-image-425" title="ARGeoViewController overlay" src="http://hamishrickerby.com/wp-content/uploads/2009/09/IMG_0337-300x200.PNG" alt="ARGeoViewController as the overlay on a ImagePickerController on iPhone" width="300" height="200" /></a><p class="wp-caption-text">ARGeoViewController as the overlay on a ImagePickerController on iPhone</p></div>
<p>I want to tidy up some of the code before I check it back into <a href="http://github.com/rickerbh/iphonearkit" target="_blank">my clone of the source</a>, but this is a really good basis for some smart location and direction aware augmented reality apps on iPhone.  Wonder what the iphonearkit license is &#8211; it&#8217;s unclear&#8230;</p>
<p>&#8212; EDIT &#8212;</p>
<p>Bugger.  It appears that <a href="http://github.com/zac/" target="_blank">zac</a> has implemented similar functionality to me already <img src='http://hamishrickerby.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />   Bloody github and it&#8217;s slow (never!) updates to fork queues and network graphs.  Oh well, maybe I won&#8217;t bother tidying my code.</p>
]]></content:encoded>
			<wfw:commentRss>http://hamishrickerby.com/2009/09/20/iphone-camera-overlays-iphonearkit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Kit Quiz: UK</title>
		<link>http://hamishrickerby.com/2009/09/11/kit-quiz-uk/</link>
		<comments>http://hamishrickerby.com/2009/09/11/kit-quiz-uk/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 08:00:50 +0000</pubDate>
		<dc:creator>Hamish Rickerby</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[mobile development]]></category>

		<guid isPermaLink="false">http://hamishrickerby.com/?p=402</guid>
		<description><![CDATA[&#60;shameless self promotion&#62; My 4th iPhone application was approved yesterday by Apple, and it launches in the iTunes store today. It&#8217;s called Kit Quiz: UK and is a UK team based football (soccer) shirt quiz game. It features over 130 shirts from UK football teams, and will have more added shortly.  There are 3 modes [...]]]></description>
			<content:encoded><![CDATA[<p>&lt;shameless self promotion&gt;</p>
<p>My 4th iPhone application was approved yesterday by Apple, and it launches in the <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=329199029" target="_blank">iTunes store</a> today.  It&#8217;s called <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=329199029" target="_blank">Kit Quiz: UK</a> and is a UK team based football (soccer) shirt quiz game.  It features over 130 shirts from UK football teams, and will have more added shortly.  There are 3 modes of gameplay, from the practise model &#8220;Friendly&#8221; to a time challenge &#8220;Blitz&#8221;.</p>
<p>It&#8217;s integrated with Twitter and Facebook so you can check out your friends scores and find out once and for all who can recognise the most football shirts.</p>
<p>Couple of screenshots below for anyone interested.  <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=329199029" target="_blank">Download it now!</a></p>
<div id="attachment_404" class="wp-caption aligncenter" style="width: 310px"><a href="http://hamishrickerby.com/wp-content/uploads/2009/09/kit-quiz-start.png" rel="lightbox[402]"><img class="size-medium wp-image-404" title="Kit Quiz: UK Menu" src="http://hamishrickerby.com/wp-content/uploads/2009/09/kit-quiz-start-300x200.png" alt="Kit Quiz: UK menu screen" width="300" height="200" /></a><p class="wp-caption-text">Kit Quiz: UK menu screen</p></div>
<div id="attachment_403" class="wp-caption aligncenter" style="width: 310px"><a href="http://hamishrickerby.com/wp-content/uploads/2009/09/kit-quiz-game.png" rel="lightbox[402]"><img class="size-medium wp-image-403" title="Kit Quiz: UK - Blitz" src="http://hamishrickerby.com/wp-content/uploads/2009/09/kit-quiz-game-300x200.png" alt="Kit Quiz: UK - Blitz screen" width="300" height="200" /></a><p class="wp-caption-text">Kit Quiz: UK - Blitz screen</p></div>
<p>&lt;/shameless self promotion&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://hamishrickerby.com/2009/09/11/kit-quiz-uk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>USSD Codes on iPhone</title>
		<link>http://hamishrickerby.com/2009/07/31/ussd-codes-on-iphone/</link>
		<comments>http://hamishrickerby.com/2009/07/31/ussd-codes-on-iphone/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 11:51:04 +0000</pubDate>
		<dc:creator>Hamish Rickerby</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mobile development]]></category>
		<category><![CDATA[telecommunications]]></category>

		<guid isPermaLink="false">http://hamishrickerby.com/?p=371</guid>
		<description><![CDATA[makeuseof.com have recently posted about 11 cool iPhone keypad codes &#8211; these are special codes (known as USSD codes) that send messages via the signalling channel direct to the core of a mobile operators network. These codes are nothing new, they have been around for years and years. They are also not generally universal (there [...]]]></description>
			<content:encoded><![CDATA[<p>makeuseof.com have recently posted about <a href="http://www.makeuseof.com/tag/cool-iphone-keypad-codes/">11 cool iPhone keypad codes</a> &#8211; these are special codes (known as <a href="http://en.wikipedia.org/wiki/Unstructured_Supplementary_Service_Data">USSD</a> codes) that send messages via the signalling channel direct to the core of a mobile operators network.  These codes are nothing new, they have been around for years and years.  They are also not generally universal (there are some standard, but they provide relatively boring functionality).  Different networks can enable different functionality on different codes.</p>
<p>The codes can do boring things like retrieve your divert status from the network, return your <a href="http://en.wikipedia.org/wiki/IMEI">IMEI</a> or perhaps <a href="http://en.wikipedia.org/wiki/ICCID">ICCID</a>, but they can also interact with specialised applications driven via <a href="http://en.wikipedia.org/wiki/USSD_Gateway">USSD Gateways</a> to return useful information and execute transactions.  These are applications that are sent specific codes by an operators core network, perform some processing on the data received, and return a response.  Things that are non-standard that are enabled by USSD Gateways are services such as USSD-based prepay balance retrieval, USSD-topup, or interactions with <a href="http://en.wikipedia.org/wiki/NGIN">NGIN</a> features to alter a network based service.</p>
<p>I looked into USSD codes on the iPhone a while back, not to be used by users typing them in, but more to be used by applications querying information from the network via them.  The reason why I wanted to programatically access them?  To look at what&#8217;s possible for network operators or enterprises to release as iPhone based network service management applications.  </p>
<p>Sadly, Apple have disable the use of USSD codes from within the (legitimate) iPhone sandbox available to developers (via the open URL methods, passing in a tel://xxxxxx URL).  This means that there won&#8217;t be any applications from your operators that will make it easy to retrieve and change network settings that can be released thru the app store &#8211; at least not until Apple change their mind about interactions with USSD codes.  Which is a pity &#8211; there are lots of useful services that would be useful to expose simple interfaces for usage for to the operators end users.  USSD is an efficient, fast way to configure the network, using capabilities that most operators already have. </p>
]]></content:encoded>
			<wfw:commentRss>http://hamishrickerby.com/2009/07/31/ussd-codes-on-iphone/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>iTunes Connect now has keywords</title>
		<link>http://hamishrickerby.com/2009/07/29/itunes-connect-now-has-keywords/</link>
		<comments>http://hamishrickerby.com/2009/07/29/itunes-connect-now-has-keywords/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 10:38:22 +0000</pubDate>
		<dc:creator>Hamish Rickerby</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mobile development]]></category>

		<guid isPermaLink="false">http://hamishrickerby.com/?p=340</guid>
		<description><![CDATA[Apple have added an extra attribute to applications on iTunes store &#8211; keywords. You can configure your keywords with the &#8220;Edit Information&#8221; link against the application. SendIt4.me (iTMS) has already been updated Be careful though. It appears you can only update your keywords ONCE per application update &#8211; so make sure you choose the right [...]]]></description>
			<content:encoded><![CDATA[<p>Apple have added an extra attribute to applications on iTunes store &#8211; keywords.</p>
<p>You can configure your keywords with the &#8220;Edit Information&#8221; link against the application.  <a href="http://sendit4.me">SendIt4.me</a> (<a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=302871160&#038;mt=8&#038;s=143441">iTMS</a>) has already been updated <img src='http://hamishrickerby.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Be careful though.  It appears you can only update your keywords ONCE per application update &#8211; so make sure you choose the right ones the first time around &#8211; otherwise you&#8217;ll have to go through the painful approvals process to get it corrected.</p>
<p>The keywords <em>should</em> help with searching for your application within the store.  Fingers crossed.</p>
<p>&#8212; EDIT &#8212;</p>
<p>You can also only have up to 100 characters for the keywords.  Don&#8217;t get caught out!  If you submit with more than 100, it tells you too late &#8211; you&#8217;ll have to resubmit your app to fix it.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-2696058307997556";
/* 468x60, created 29/07/09 */
google_ad_slot = "3174546356";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://hamishrickerby.com/2009/07/29/itunes-connect-now-has-keywords/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My first iPhone app approved &#8211; finally</title>
		<link>http://hamishrickerby.com/2009/05/11/my-first-iphone-app-approved-finally/</link>
		<comments>http://hamishrickerby.com/2009/05/11/my-first-iphone-app-approved-finally/#comments</comments>
		<pubDate>Mon, 11 May 2009 19:50:09 +0000</pubDate>
		<dc:creator>Hamish Rickerby</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mobile development]]></category>

		<guid isPermaLink="false">http://hamishrickerby.com/?p=325</guid>
		<description><![CDATA[Send real postcards to your family and friends with SendIt4.me, now available as an iPhone client. The application is 100% free and each postcard you send will cost $2USD. The postcards can be sent anywhere in the world, and postage time is dependent on your international and local mail services (they are posted from the [...]]]></description>
			<content:encoded><![CDATA[<p>Send real postcards to your family and friends with <a href="http://sendit4.me">SendIt4.me</a>, now available as an <a href="http://is.gd/yVcY">iPhone client</a>.  The application is 100% free and each postcard you send will cost $2USD.  The postcards can be sent anywhere in the world, and postage time is dependent on your international and local mail services (they are posted from the US, so if you live there you should get it quicker).</p>
<p><a href="http://is.gd/yVcY">Download now!</a></p>
<p><a href="http://is.gd/yVcY"><img src="http://hamishrickerby.com/wp-content/uploads/2009/05/sendit4me-208x300.png" alt="sendit4me" title="sendit4me" width="208" height="300" class="alignnone size-medium wp-image-327" /></a></p>
<p><em>Sidenote: I submitted this application initially to Apple on the 18th Jan 2009.  It was finally approved tonight.  There was only 1 &#8220;Please wait&#8221; mail, and one &#8220;We need some help testing it&#8221; mail &#8211; too long in my opinion. </em></p>
]]></content:encoded>
			<wfw:commentRss>http://hamishrickerby.com/2009/05/11/my-first-iphone-app-approved-finally/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cocos2d-iphone blocking touch events</title>
		<link>http://hamishrickerby.com/2009/02/01/cocos2d-iphone-blocking-touch-events/</link>
		<comments>http://hamishrickerby.com/2009/02/01/cocos2d-iphone-blocking-touch-events/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 08:59:05 +0000</pubDate>
		<dc:creator>Hamish Rickerby</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mobile development]]></category>

		<guid isPermaLink="false">http://hamishrickerby.com/?p=285</guid>
		<description><![CDATA[The game development is going well so far.  From yesterday when I knew NOTHING about game development I&#8217;ve managed to figure out how to use sprites, labels, timed actions, sequenced actions, scenes and layers with cocos2d-iphone. I did hit a strange error though.  On the simulator the touch events were working correctly &#8211; screens transitioning, [...]]]></description>
			<content:encoded><![CDATA[<p>The game development is going well so far.  From yesterday when I knew NOTHING about game development I&#8217;ve managed to figure out how to use sprites, labels, timed actions, sequenced actions, scenes and layers with cocos2d-iphone.</p>
<p>I did hit a strange error though.  On the simulator the touch events were working correctly &#8211; screens transitioning, sprite/label touches generating events and triggering animation and so on.  On the actual device the story was quite different.  My menu items were triggering correctly, but no subsequent touch events were doing anything on the phone.  When the application exited (home button) all the touch events were then passed through as I could see them all fly up the screen in the console.</p>
<p>A long search in google yielded the following page:  <a href="http://groups.google.com/group/cocos2d-iphone-discuss/browse_thread/thread/8aae440d81721ff4" target="_blank">http://groups.google.com/group/cocos2d-iphone-discuss/browse_thread/thread/8aae440d81721ff4</a></p>
<p>I don&#8217;t know what causes the actual issue, but the fix is to alter the Director.m&#8217;s main method &#8211; adding the following code fixed the issue right up.</p>
<pre class="brush: cpp;">

while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, YES) ==  kCFRunLoopRunHandledSource) {}; 
</pre>
<p>The odd thing is (and let me know if I&#8217;m wrong here) that that code doesn&#8217;t actually do anything.  It performs a test, but changes nothing.  I don&#8217;t get why this fix works.</p>
<p>?</p>
]]></content:encoded>
			<wfw:commentRss>http://hamishrickerby.com/2009/02/01/cocos2d-iphone-blocking-touch-events/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>error on line 1987</title>
		<link>http://hamishrickerby.com/2009/01/31/error-on-line-1987/</link>
		<comments>http://hamishrickerby.com/2009/01/31/error-on-line-1987/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 07:37:48 +0000</pubDate>
		<dc:creator>Hamish Rickerby</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mobile development]]></category>

		<guid isPermaLink="false">http://hamishrickerby.com/?p=279</guid>
		<description><![CDATA[I am having a bit of a play with the cocos2d game engine for iPhone and encountered a very strange error in the console &#8211; I don&#8217;t believe it&#8217;s at all related to the game engine itself, so it&#8217;s just coincidence that I was trying something new out. error while killing target (killing anyway): warning: [...]]]></description>
			<content:encoded><![CDATA[<p>I am having a bit of a play with the <a href="http://code.google.com/p/cocos2d-iphone/">cocos2d</a> game engine for iPhone and encountered a very strange error in the console &#8211; I don&#8217;t believe it&#8217;s at all related to the game engine itself, so it&#8217;s just coincidence that I was trying something new out.</p>
<p>error while killing target (killing anyway): warning: error on line 1987 of &#8220;/SourceCache/gdb/gdb-962/src/gdb/macosx/macosx-nat-inferior.c&#8221; in function &#8220;macosx_kill_inferior_safe&#8221;: (os/kern) failure (0x5x)</p>
<p>I figured out that it had to do with definition of a selector&#8230;  Naughty code below.</p>
<pre class="brush: cpp;">
MenuItem *start = [MenuItemFont itemFromString:@&quot;Start Game&quot;
                                        target:self
                                      selector:@selector(startGame)];
</pre>
<p>The problem is that the method name inside @selector() MUST have a colon on the back of it.</p>
<p>Good code</p>
<pre class="brush: cpp;">
MenuItem *start = [MenuItemFont itemFromString:@&quot;Start Game&quot;
                                        target:self
                                      selector:@selector(startGame:)];
</pre>
<p>Hope that&#8217;s useful to someone.</p>
]]></content:encoded>
			<wfw:commentRss>http://hamishrickerby.com/2009/01/31/error-on-line-1987/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
