<?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>boardyUK.com &#187; Software Development</title>
	<atom:link href="http://boardyuk.com/category/software-dev/feed/" rel="self" type="application/rss+xml" />
	<link>http://boardyuk.com</link>
	<description></description>
	<lastBuildDate>Sat, 03 Jul 2010 18:19:00 +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 App in a day &#8211; Warm-Up Weights</title>
		<link>http://boardyuk.com/2010/02/07/iphone-app-in-a-day-warm-up-weights/</link>
		<comments>http://boardyuk.com/2010/02/07/iphone-app-in-a-day-warm-up-weights/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 23:01:20 +0000</pubDate>
		<dc:creator>Adam Boardman</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[App-in-a -day]]></category>
		<category><![CDATA[Interface Builder]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://www.boardyuk.com/?p=286</guid>
		<description><![CDATA[After spending a while sorting out my MacBook Pro with all my audio software I needed a break from that so decided to challenge myself into building an iPhone application that I personally would find ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.boardyuk.com/wp-content/uploads/2010/02/logo.png"><img class="alignleft size-full wp-image-285" title="boardy-logo" src="http://www.boardyuk.com/wp-content/uploads/2010/02/logo.png" alt="" width="57" height="57" /></a>After spending a while sorting out my MacBook Pro with all my audio software I needed a break from that so decided to challenge myself into building an iPhone application that I personally would find useful, and would use a lot. This app would have to be written and fully working in one day (24 hours) from start to finish whatever I decided to build. It so happened that the app I built today took just under an hour to build to the point I wanted it at, so I&#8217;ll use the remaining 23 hours to pretty it up later in the month.</p>
<p>I came up with a few ideas along the way but something I&#8217;m constantly needing while at the gym is a weight calculator for my warm-up sets. Normally I would use the built-in calculator in iPhone OS3 and workout each weight individually as I needed to, so I thought that surely it would be easier and quicker to have all those individual weights in one place, and only have to enter one weight for them all to be calculated at the same time.<span id="more-286"></span></p>
<p>Working out these weights is a straight forward enough process as they are just percentages of the max weight I managed the previous session starting at 50%, and increasing 10% up to 90%. I needed this displayed in a logical way, and decided on the 100% weight being at the top, and then the warm-up weights going down the screen from 50% to 90%, with a button at the bottom of the list to make the magic happen so to speak.</p>
<p>I fired up Xcode and got to work on this little utility app. I am so used to developing using the cocos2d-iPhone framework that I accidentally fired up one of those templates and had to go back and start again with a standard View-based Application. This would require me to actually make use of Interface Builder which I&#8217;ve not used since I first looked at iPhone development back in November whilst working through the &#8220;Beginning iPhone 3 Development: Exploring the iPhone SDK&#8221; book, which is fantastic by the way!</p>
<p>First stop for me was building the UI for the app so I fired up IB and got to it. The app uses one text field, some labels, and a round rect button so as far as interfaces go, this is pretty simple. Some labels are there specifically just to indicate weight percentages, whereas others hold the values of the weights and only become visible when the user has input their 100% weight.</p>
<p><a href="http://www.boardyuk.com/wp-content/uploads/2010/02/IB.png"><img class="size-medium wp-image-288 alignleft" title="Warm-Up IB" src="http://www.boardyuk.com/wp-content/uploads/2010/02/IB-300x206.png" alt="" width="300" height="206" /></a>As you can see in the screen shot it&#8217;s not the prettiest looking thing in the world, however it does the job it&#8217;s meant to and that&#8217;s what I care about at the moment. If your an iPhone developer you may have noticed the UIView has been changed to a UIControl which allows actions, that allows me to fire off stuff from touches to the view.</p>
<p>So that&#8217;s the interface built and ready, now for the coding of the actual thing. I spent about 10min thinking about what actually needed to happen to get everything to happen at the same time, I didn&#8217;t want to have one value update, then the next, then the next, and so on, I wanted everything to happen at the touch of the &#8220;Find Weights&#8221; button. This needed one utility method and a main method which did the updating, which wasn&#8217;t too much work to muddle through.</p>
<pre class="brush: objc;">-(void)udpateLabels {

 float full = [fullField.text intValue];

 if (fullField.text.length &gt; 0) {
 fiftyLabel.text = [[NSString alloc] initWithFormat:@&quot;%2.1f&quot;, [self findPercent:50 :full]];
 sixtyLabel.text = [[NSString alloc] initWithFormat:@&quot;%2.1f&quot;, [self findPercent:60 :full]];
 seventyLabel.text = [[NSString alloc] initWithFormat:@&quot;%2.1f&quot;, [self findPercent:70 :full]];
 eightyLabel.text = [[NSString alloc] initWithFormat:@&quot;%2.1f&quot;, [self findPercent:80 :full]];
 ninetyLabel.text = [[NSString alloc] initWithFormat:@&quot;%2.1f&quot;, [self findPercent:90 :full]];
 }
}

-(float)findPercent:(int)percent : (float)full {
 float divide = full / 100;
 float result = divide * percent;

 return result;
}</pre>
<p>The code for these methods is pretty simple, I first set a floating point to the contents of the text field then using an if statement check that a value is present, if there is no value then I do nothing and nothing is changed on screen, if however there is a value in the box then that value is run through the findPercent method. This utility method just runs the calculations on the 100% value to get back the value of the given percentage, for example if the percentage was 60% the method would look like this.</p>
<pre class="brush: objc;">-(float)findPercent:60 percent : (float)full {
 float divide = full / 100;
 float result = divide * 60;

 return result;
 }</pre>
<p>Doing things this way enables everything to happen at once as far as the user is aware, however the program will actually run through the if statement until each of the values is filled.</p>
<p>I&#8217;ve already found a few things I&#8217;m going to change with this app even though I&#8217;ve just built it and they are, in no particular order -</p>
<ul>
<li>Custom keyboard with a decimal point as the current numeric keyboard doesn&#8217;t offer one</li>
<li>An alert window if the user hasn&#8217;t input a value for 100% but clicks the button</li>
<li>Possibly removing the button completely and running the updateLabels method on the keyboard closing</li>
<li>Much prettier UI</li>
</ul>
<p align="left"> <a target="_blank" class="tt" href="http://twitter.com/home/?status=iPhone+App+in+a+day+%E2%80%93+Warm-Up+Weights+http://is.gd/cJUyv" title="Post to Twitter">Tweet This Post</a></p><img src="http://boardyuk.com/?ak_action=api_record_view&id=286&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://boardyuk.com/2010/02/07/iphone-app-in-a-day-warm-up-weights/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cocos2d-iPhone and a start</title>
		<link>http://boardyuk.com/2010/01/10/cocos2d-iphone-and-a-start/</link>
		<comments>http://boardyuk.com/2010/01/10/cocos2d-iphone-and-a-start/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 23:38:21 +0000</pubDate>
		<dc:creator>Adam Boardman</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[University]]></category>
		<category><![CDATA[cocos2d]]></category>
		<category><![CDATA[dissertation]]></category>
		<category><![CDATA[grid]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://www.boardyuk.com/?p=249</guid>
		<description><![CDATA[Well during Christmas and my holiday break at my parents I did a fair bit of reading up on iPhone development, and game development for mobile devices, iPhone in particular. I got a new book ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.boardyuk.com/wp-content/uploads/2010/01/Official-COCOS-Icon-Happy.jpg"><img class="alignleft size-thumbnail wp-image-255" title="Official-COCOS-Icon-Happy" src="http://www.boardyuk.com/wp-content/uploads/2010/01/Official-COCOS-Icon-Happy-150x150.jpg" alt="" width="150" height="150" /></a>Well during Christmas and my holiday break at my parents I did a fair bit of reading up on iPhone development, and game development for mobile devices, iPhone in particular. I got a new book which I have only skimmed through so far but seems pretty interesting and has some good ideas in it which should help during the production of my app.</p>
<p>I have started to get the hang of using Xcode after using it for a longer time now. I&#8217;m not overly keen on the Interface Builder however as I&#8217;m using Cocos2d-iPhone I shouldn&#8217;t need to make much use of Interface Builder. I feel that after really learning how it all works and what does what then it is a really powerful tool, however currently it just seems to be quicker for me to hand-code what I&#8217;m trying to do. This could be a stupid idea on my part but only time will tell.</p>
<p>My application has started to take shape finally after a few weeks of sitting in a state where I could register taps on the screen as screen co-ordinates in console, which seems to be pretty much game development 101 sort of stuff. Now moving on a bit from that I have (with a bit of back down to earth help from my dad) managed to get a virtual 20x20px grid working in my touch layer of the game so that a touch within a certain 20x20px cell is registered as one location on screen, for example, if a user touched the screen at screen co-ordinates (3,19) then that would be cell (1,1) in the console, however if a user touches (25,19) then that would be grid cell (2,1).</p>
<p>This has taken me a while to get working as for some reason I completely forgot that screen co-ordinates are only numbers, and there can only be a certain amount of pixels on the screen, once my dad had reminded me of this fact I was away and could finally get my grid working. Currently the only thing it can do is log the start location, end location, and also track a drag through the grid cells to the console.</p>
<p>The next step for me is to get a 20x20px sprite to stick to the location where the user has tapped but to use the grid cell as its reference, for example, if cell (1,1) is screen co-ordinate (0-19, 0-19) and a user touched (13, 5) then the sprite would not use (13, 5) as its anchor point, but instead will use (0, 0) as its anchor, sprites should anchor from the bottom left corner using this method. Once I have a single sprite working I will then look into getting multiple sprites working at once, and then onto tracking a drag work either placing a sprite or removing an instance of one depending on where the user has dragged their finger.</p>
<p>Once I have this working I&#8217;ll actually get around to posting some example code in a short post soon.</p>
<p align="left"> <a target="_blank" class="tt" href="http://twitter.com/home/?status=Cocos2d-iPhone+and+a+start+http://is.gd/cJWfP" title="Post to Twitter">Tweet This Post</a></p><img src="http://boardyuk.com/?ak_action=api_record_view&id=249&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://boardyuk.com/2010/01/10/cocos2d-iphone-and-a-start/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Initial iPhone development thoughts</title>
		<link>http://boardyuk.com/2009/11/21/initial-iphone-development-thoughts/</link>
		<comments>http://boardyuk.com/2009/11/21/initial-iphone-development-thoughts/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 23:38:00 +0000</pubDate>
		<dc:creator>Adam Boardman</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://www.boardyuk.com/?p=67</guid>
		<description><![CDATA[I&#8217;ve been using the iPhone SDK in Xcode for about two weeks now so I thought it was about time to actually document my thoughts on the tools. I&#8217;m a user of TextMate when building ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-thumbnail wp-image-158" title="xcode" src="http://www.boardyuk.com/wp-content/uploads/2009/12/xcode-150x150.jpg" alt="xcode" width="150" height="150" />I&#8217;ve been using the iPhone SDK in Xcode for about two weeks now so I thought it was about time to actually document my thoughts on the tools. I&#8217;m a user of TextMate when building web based apps in PHP, which is a great tool and does the job brilliantly for PHP, but I can understand why Apple make you use Xcode. The code completion is great, you can go directly to a function or class description in the API just by double clicking on the name of it while holding alt.</p>
<p>There are a few things I&#8217;ve noticed however while developing a few test apps which did surprise me slightly, one such thing is the keyboard for a text field. A user would generally expect this to disappear when &#8216;Done&#8217; is clicked, or they tap off the keyboard, for some reason Apple didn&#8217;t think it right to include that code directly into the text field object, but rather the developer has to create it. There are a few other little quirks in Xcode that I still haven&#8217;t figured out yet, however I have only been using it for 2 weeks so I guess in time these will become obvious what they do.</p>
<p>So far I&#8217;m pretty impressed with the ease of using Xcode and the Objective-C language to create applications for iPhone OS 3, couple that with Interface Builder and it makes it pretty quick to deliver an application for iPhone OS 3. I have yet to get into Core Data or SQLlite for data storage but I&#8217;m always moving forwards.</p>
<p align="left"> <a target="_blank" class="tt" href="http://twitter.com/home/?status=Initial+iPhone+development+thoughts+http://is.gd/cJVah" title="Post to Twitter">Tweet This Post</a></p><img src="http://boardyuk.com/?ak_action=api_record_view&id=67&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://boardyuk.com/2009/11/21/initial-iphone-development-thoughts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
