<?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>tapadoo &#187; development</title>
	<atom:link href="http://tapadoo.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://tapadoo.com</link>
	<description>Incredible Mobile App Development</description>
	<lastBuildDate>Mon, 23 Jan 2012 17:42:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>Is this ipa signed for your device?</title>
		<link>http://tapadoo.com/2011/is-this-ipa-signed-for-your-device/</link>
		<comments>http://tapadoo.com/2011/is-this-ipa-signed-for-your-device/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 12:36:36 +0000</pubDate>
		<dc:creator>dermdaly</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://tapadoo.com/?p=694</guid>
		<description><![CDATA[Its a common issue for iPhone app developers. You sign the build and put it on the web server. You download and it work on your own devices. You send the link to the client and the respond that it [...]]]></description>
			<content:encoded><![CDATA[<p>Its a common issue for iPhone app developers.  You sign the build and put it on the web server.  You download and it work on your own devices.  You send the link to the client and the respond that it doesn&#8217;t work for them.</p>
<p>There&#8217;s a number of places where you could have made a mistake.  You developer cert could have been incorrect.<br />
You may have added their UDID to the portal, but forgot to add it to the provisioning certificate.<br />
You may have added it, but not used the correct profile when making the build.<br />
You may have done all this right, but not put the correct binary on the webserver</p>
<p>..and so on.  We&#8217;ve all been there.</p>
<p>So, how can you tell if an ipa is actually signed for a client&#8217;s UDID.  Well you could download/extract/find the provisioning file, etc. </p>
<p>Or you could use a handy command line script we&#8217;ve thrown together and put on github which does all this for you.</p>
<p>Hope you find it useful<br />
<a href="https://github.com/dermdaly/listdevs">https://github.com/dermdaly/listdevs</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tapadoo.com/2011/is-this-ipa-signed-for-your-device/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Regular problem with XML to JSON Converters</title>
		<link>http://tapadoo.com/2011/regular-problem-with-xml-to-json-converters/</link>
		<comments>http://tapadoo.com/2011/regular-problem-with-xml-to-json-converters/#comments</comments>
		<pubDate>Tue, 22 Feb 2011 23:00:35 +0000</pubDate>
		<dc:creator>dermdaly</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[iphonedev]]></category>

		<guid isPermaLink="false">http://tapadoo.com/?p=532</guid>
		<description><![CDATA[Here at tapadoo, we&#8217;ve done a number of apps which communicate with back end data servers. Typically this means a RESTful API with JSON or XML payloads. There&#8217;s one issue we&#8217;ve come across on a number of projects, where we&#8217;re [...]]]></description>
			<content:encoded><![CDATA[<p>Here at tapadoo, we&#8217;ve done a number of apps which communicate with back end data servers.  Typically this means a RESTful API with JSON or XML payloads.<br />
There&#8217;s one issue we&#8217;ve come across on a number of projects, where we&#8217;re dealing with an existing Web API which is presenting the payloads in JSON.<br />
The problem is where arrays are incorrectly serialized in certain cases.  Specifically we&#8217;ve seen:</p>
<ul>
<li>When an array has more than 1 entry, it is serialized correctly</li>
<li>When the array has only 1 entry, it is serialized not as an array, but as a single dictionary.</li>
</ul>
<p><strong>Firstly, lets explain why this has occurred</strong><br />
If you consider the following XML:</p>
<pre>
&lt;team&gt;
    &lt;employee&gt;
      &lt;name&gt;Joe&lt;/name&gt;
      &lt;surname&gt;Bloggs&lt;/surname&gt;
  &lt;/employee&gt;
  &lt;employee&gt;
    &lt;name&gt;Jane&lt;/name&gt;
    &lt;surname&gt;Doe&lt;/surname&gt;
  &lt;/employee&gt;
&lt;/team&gt;
</pre>
<p>A typical XML to JSON converter will convert this as follows:</p>
<pre>
{
  team:{
    employee:[
      {
        name:'Joe',
        surname:'Bloggs'
      },
      {
        name:'Jane',
        surname:'Doe'
      }
    ]
  }
}
</pre>
<p>I.e It is converted to a Dictionary, with a key called &#8216;team&#8217; whose value is a Dictionary, with a key called &#8216;employee&#8217; which is an array of Dictionaries (with keys of &#8216;name&#8217; and &#8216;surname&#8217;).</p>
<p>Great.<br />
However if the XML was a team with a single entry:</p>
<pre>
&lt;team&gt;
    &lt;employee&gt;
      &lt;name&gt;Joe&lt;/name&gt;
      &lt;surname&gt;Bloggs&lt;/surname&gt;
  &lt;/employee&gt;
&lt;/team&gt;
</pre>
<p>The XML to JSON converter has no context on Employee.  It has now way of knowing that this is potentially a repeating group (especially if it has no XSD to consult), so it converts the XML to the following JSON:</p>
<pre>
{
  team:{
    employee:{
      name:'Joe',
      surname:'Bloggs'
    }
  }
}
</pre>
<p>So, this is now a Dictionary, with a key called &#8216;team&#8217; whose value is a dictionary with a key called &#8216;employee&#8217; whose value is  a Dictionary.</p>
<p>The problem here is when we go to parse, we expect the value of &#8216;employee&#8217; to be an array (which it isn&#8217;t), and this can lead to problems in the code.  </p>
<p>And..due to Objective-C loose approach to type, the following code will run:<br />
<code><br />
NSArray *array = [teamDict objectForKey:@"employee"];<br />
</code></p>
<p>In those cases where there team has a number of employees, the above code works fine, and the pointer, array stores an array.  In those cases where a team as a single employee, the above code runs, however the pointer, array will actually point to a NSDictionary.  So the following code (for example)<br />
<code><br />
int numEntries = [array count];<br />
</code><br />
Will sometimes work, and sometimes lead to a runtime error, which on iPhone will manifest itself as a crash.</p>
<p><strong>So how do we fix this?</strong><br />
Well, if you have control over the server side, the simple question is to fix it in the first place.  Note: This is a common problem with JAXB, a popular java XML binding mechanism often used in REST services written in Java.  We&#8217;ve come across some examples on how to work around it <a href="http://forums.netbeans.org/post-68036.html">here</a> and <a href="http://jersey.576304.n2.nabble.com/Single-Element-Arrays-and-JSON-td5532105.html">here</a>.</p>
<p>If you have no control over this, you may be able to handle this in your Objective-C code.  Here&#8217;s some sample code we&#8217;ve started to use; It checks the data type at runtime, and if necessary, converts it to a single element array</p>
<pre>
+(NSArray *) getArrayFromJSONDictionary:(NSDictionary *)parent
               forKey:(NSString *)key {
  id obj = [parent objectForKey:key];
  if([obj isKindOfClass:[NSArray class]]) {
    return obj;
  }
  if([obj isEqual:[NSNull null]]) {
    NSLog(@"Warning: object for key %@ is null", key);
    // Return an empty array
    return [[[NSArray alloc] init] autorelease];
  }
  NSLog(@"Warning object for key %@ is of type %@",
        key, [[obj class] description]);
  NSArray *ret = [NSArray arrayWithObject:obj];
  return ret;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://tapadoo.com/2011/regular-problem-with-xml-to-json-converters/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Tired of trying to create nice buttons for your iPhone app?  Try this.</title>
		<link>http://tapadoo.com/2010/tired-of-trying-to-create-nice-buttons-for-your-iphone-app-try-this/</link>
		<comments>http://tapadoo.com/2010/tired-of-trying-to-create-nice-buttons-for-your-iphone-app-try-this/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 17:29:19 +0000</pubDate>
		<dc:creator>dermdaly</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[iphonedev]]></category>

		<guid isPermaLink="false">http://tapadoo.com/?p=419</guid>
		<description><![CDATA[Flat iPhone buttons as offered in Interface builder suck. They don&#8217;t look nice. There&#8217;s the option of using Three20 to get good looking buttons. Its an option, but frankly, it feels a bit like using a sledgehammer to crack a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Flat iPhone buttons as offered in Interface builder suck</strong>.  They don&#8217;t look nice.</p>
<p>There&#8217;s the option of using Three20 to get good looking buttons.  Its an option, but frankly, it feels a bit like using a sledgehammer to crack a nut.  You end up with a large addition to your code, just for nice buttons.  OK, you could go to the trouble of stripping out what you don&#8217;t need, but that again is more work.</p>
<p>All iPhone developers know about UIGlassButton &#8211; Its an undocumented API for making nice looking buttons, that exists only on the simulator and not on the iPhone itself.  Why couldn&#8217;t we just have that for iPhone OS?  I dunno, but its not there.</p>
<p>At some point in the past, I came across a nice snippet of code that used undocumented techniques for creating a glass button, and then saving the image to disk.  This could then be used as a background to a &#8220;custom button&#8221;, producing the nice glass buttons I&#8217;ve been looking for. I think it was <a href="http://twitter.com/schwa">schwa</a> on twitter; Nice.  Full credit where it&#8217;s due.</p>
<p>So, building upon this, I&#8217;ve thrown together a simple single-screen app for creating the images for glass buttons using that technique.  Basically, it allows you set the RGB values, and the size.  Hitting &#8220;Save&#8221; writes the pngs to the application&#8217;s documents directory.<br />
Now, you&#8217;ll have two png files, which you can use as images in custom buttons.  Hey presto.  Very simple UIGlassButtons.<br />
Here&#8217;s a screen shot:</p>
<div id="attachment_422" class="wp-caption aligncenter" style="width: 424px"><img class="size-full wp-image-422" title="Screen shot 2010-04-29 at 18.31.32" src="http://tapadoo.com/wp-content/uploads/2010/04/Screen-shot-2010-04-29-at-18.31.32.png" alt="Our very simple button maker" width="300" height="563" /><p class="wp-caption-text">Our very simple button maker</p></div>
<p>Full source is <a href="http://github.com/dermdaly/ButtonMaker">available on github</a>.  Comments welcome.</p>
<hr/>
<p>You&#8217;re reading the tapadoo blog.  Did you know that as well as publishing our own applications, we offer iPhone development services and consultancy?  If you have an idea, project or something you think we can help you with, please get in touch through <a href="http://www.tapadoo.com/contact/">our contact page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tapadoo.com/2010/tired-of-trying-to-create-nice-buttons-for-your-iphone-app-try-this/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Project Firepit</title>
		<link>http://tapadoo.com/2010/project-firepit/</link>
		<comments>http://tapadoo.com/2010/project-firepit/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 12:35:10 +0000</pubDate>
		<dc:creator>dermdaly</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[iphonedev]]></category>

		<guid isPermaLink="false">http://tapadoo.com/?p=412</guid>
		<description><![CDATA[We&#8217;ve had our heads down for a couple of months. This is because we&#8217;ve been working on a project we&#8217;re very excited about. Now that our initial release is out the door, we&#8217;re happy to give out some information about [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve had our heads down for a couple of months.  This is because we&#8217;ve been working on a project we&#8217;re very excited about.  Now that our initial release is out the door, we&#8217;re happy to give out some information about it.</p>
<p>That project is <strong>Firepit</strong>.<br />
<img src="http://tapadoo.com/wp-content/uploads/2010/04/fp-logo-white.png" alt="fp-logo-white" title="fp-logo-white" width="400" height="169" class="aligncenter size-full wp-image-413" /><br />
<strong>What is Firepit</strong>?<br />
Firepit is </p>
<ol>
<li>A web based framework</li>
<li>For bands going on tour&#8230;</li>
<li>..which allows them to produce iPhone applications..</li>
<li>..that are &#8220;virtual tour programmes&#8221;</li>
</ol>
<p>We just got out the first Firepit release today: The App is &#8220;<a href="http://usefirepit.com/ultravox">Ultravox &#8211; Return to Eden II</a>&#8220;, and it is on release on the app store worldwide.</p>
<p>We&#8217;re delighted that Ultravox are on board.  They&#8217;ve been an avid supporter of the project for some weeks, getting behind the idea, and supplying some great exclusive content.  A quick look over <a href="http://twitter.com/midgeure1">Midge Ure&#8217;s Twitter stream</a> shows he&#8217;s being doing some beta testing, and bigging up the app.</p>
<p>Hope y&#8217;all like it.</p>
]]></content:encoded>
			<wfw:commentRss>http://tapadoo.com/2010/project-firepit/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Style guidelines and pot roasts</title>
		<link>http://tapadoo.com/2010/style-guidelines-and-pot-roasts/</link>
		<comments>http://tapadoo.com/2010/style-guidelines-and-pot-roasts/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 20:41:28 +0000</pubDate>
		<dc:creator>dermdaly</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://tapadoo.com/?p=353</guid>
		<description><![CDATA[In many companies I&#8217;ve worked I&#8217;ve engaged in the usual &#8220;style wars&#8221;. It goes like this. A senior developer decides that for the new project, the entire team should use a single style. This will mean that the code is [...]]]></description>
			<content:encoded><![CDATA[<p>In many companies I&#8217;ve worked I&#8217;ve engaged in the usual &#8220;style wars&#8221;.  It goes like this.  </p>
<ol>
<li>A senior developer decides that for the new project, the entire team should use a single style.  This will mean that the code is consistent across the project and make it easier for developers to work on each other&#8217;s code.  It also means there will be a level of consistency on commenting etc.</li>
<li>A sub-group is put together to decide the guidelines.</li>
<li>The guidelines are issued</li>
<li>The team fight over them</li>
<li>A manager steps in and tells them to use the ones laid down.</li>
<li>There&#8217;s huffing and puffing but eventually everyone uses it.</li>
</ol>
<p>Well, that&#8217;s been my experience anyway.<br />
But, its always the fight that interesting.  People fighting over where its a newline before an curly brace or not, hungarian notation or not, tabs versus spaces always makes me think that people are missing the point somewhat.<br />
The point is about consistency.  The arguments are usually about some people consider more whitespace more readable, whilst others think that the more code on the page, gives you a better understanding of what the code does, without having to always page up and down.</p>
<p>So&#8230;when you have a few years under your belt, you realise this, and you sit back, enjoy the fireworks knowing that the manager will step in, put an end to the arguing, and we&#8217;ll get our consistency mojo.</p>
<p>But&#8230;.every now and then I do feel that some rules are just stoopid.  I was reading the excellent <a href="http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml">google style guidelines for Objective-C</a> tonight and saw <em>my</em> personal pet peeve stupid styleguide rule:</p>
<blockquote><p>
Each line of text in your code should be at most 80 characters long.</p></blockquote>
<p>Why?<br />
<strong>Why?</strong><br />
Why not 79 characters?  Why not 81?  Why not more?<br />
I know why.<br />
Before we had GUIs, your typical PC, or VAX Terminal, etc had a width of 80 characters.  Printers too.  Typically printed 80 characters per line.<br />
But c&#8217;mon.  We&#8217;ve not used text terminals for years, and a typical monitor can show much wider than 80 characters.  And&#8230;we never print code anymore; If we did, the printer can handle more than 80 characters wide anyway.</p>
<p>I think its silly to have a style guide that was relevant in 1990, but has no relevance to the real world apart from &#8220;that&#8217;s how gran did it&#8221;.</p>
<p>There&#8217;s an excellent couple of books by a guy called Steve Maguire.  One is called &#8220;Writing Solid Code&#8221; and another is called &#8220;Debugging the development process&#8221;.  They are more relevant to writing C code, but the sentiments in them are excellent, and I still think all developers should at least read &#8220;Writing Solid Code&#8221;.  There&#8217;s a great anecdote in &#8220;Debugging the development process&#8221; that as I remember it, is about Steve&#8217;s wife and her pot roast.  It went like this (I hope Steve doesn&#8217;t mind me quoting it):</p>
<blockquote><p>&#8220;A boy asked his mother how come she cuts off the edges of a pot roast when putting it into the pot. Mother told him that that&#8217;s how her mother taught her to do. So, boy went to his grandmother and he got the same answer. Then he went to his grand-grandmother and ask her the same question. The answer was: Well, back then my pot was to small and the meat didn&#8217;t fit inside.&#8221;
</p></blockquote>
<p>80 Characters per line when writing code: Pot roast rules for developers.</p>
<hr/>
<p>You&#8217;re reading the tapadoo blog.  Did you know that as well as publishing our own applications, we offer iPhone development services and consultancy?  If you have an idea, project or something you think we can help you with, please get in touch through <a href="http://www.tapadoo.com/contact/">our contact page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tapadoo.com/2010/style-guidelines-and-pot-roasts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

