<?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>Mindsizzlers</title>
	<atom:link href="http://www.mindsizzlers.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mindsizzlers.com</link>
	<description>Bringing Ideas to Life</description>
	<lastBuildDate>Tue, 26 Jul 2011 09:43:43 +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>Successful iOS Background Location reporting</title>
		<link>http://www.mindsizzlers.com/2011/07/ios-background-location/</link>
		<comments>http://www.mindsizzlers.com/2011/07/ios-background-location/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 09:41:03 +0000</pubDate>
		<dc:creator>Roger</dc:creator>
				<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[location]]></category>

		<guid isPermaLink="false">http://www.mindsizzlers.com/?p=632</guid>
		<description><![CDATA[We&#8217;re working on a location product right now and one of the little challenges along the way has been how to report background location updates back to our servers. First, some basics. We&#8217;re going to be using the Significant Location Changes feature introduced with iOS 4 as this is the recommended way of tracking the [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re working on a location product right now and one of the little challenges along the way has been how to report background location updates back to our servers.</p>
<p>First, some basics.</p>
<p>We&#8217;re going to be using the Significant Location Changes feature introduced with iOS 4 as this is the recommended way of tracking the approximate device location in a low power way. As always, <a href="http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html">the Apple documentation is excellent</a> and is worth reading so you are aware of the detail.</p>
<p><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/07/location-ios.png"><img class="alignnone size-full wp-image-633" title="location-ios" src="http://www.mindsizzlers.com/wp-content/uploads/2011/07/location-ios.png" alt="" width="540" height="245" /></a></p>
<p>Note the really key features here;</p>
<p>a) If the application is suspended when an update occurs, <strong>the system wakes it up in the background</strong> to handle the update.</p>
<p>b) If the application starts this service and is then terminated, <strong>the system relaunches the application automatically</strong> when a new location becomes available.</p>
<p>That&#8217;s just perfect, so what we can now do is turn on significant location updates when the user hits the home key and we can let the system wake us up when needed.</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><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> applicationDidEnterBackground<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIApplication <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> application
<span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">// You will also want to check if the user would like background location</span>
    <span style="color: #11740a; font-style: italic;">// tracking and check that you are on a device that supports this feature.</span>
    <span style="color: #11740a; font-style: italic;">// Also you will want to see if location services are enabled at all.</span>
    <span style="color: #11740a; font-style: italic;">// All this code is stripped back to the bare bones to show the structure</span>
    <span style="color: #11740a; font-style: italic;">// of what is needed.</span>
&nbsp;
       <span style="color: #002200;">&#91;</span>locationManager startMonitoringSignificantLocationChanges<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Then to perhaps switch to higher accuracy when the application is started up, use;</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><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> applicationDidBecomeActive<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIApplication <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> application
<span style="color: #002200;">&#123;</span>
       <span style="color: #002200;">&#91;</span>locationManager stopMonitoringSignificantLocationChanges<span style="color: #002200;">&#93;</span>;
       <span style="color: #002200;">&#91;</span>locationManager startUpdatingLocation<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Next you&#8217;ll likely want to change your location manager delegate to handle background location updates.</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><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> locationManager<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CLLocationManager <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>manager didUpdateToLocation<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CLLocation <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>newLocation fromLocation<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CLLocation <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>oldLocation
<span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">BOOL</span> isInBackground <span style="color: #002200;">=</span> <span style="color: #a61390;">NO</span>;
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span>.applicationState <span style="color: #002200;">==</span> UIApplicationStateBackground<span style="color: #002200;">&#41;</span>
    <span style="color: #002200;">&#123;</span>
        isInBackground <span style="color: #002200;">=</span> <span style="color: #a61390;">YES</span>;
    <span style="color: #002200;">&#125;</span>
&nbsp;
    <span style="color: #11740a; font-style: italic;">// Handle location updates as normal, code omitted for brevity.</span>
    <span style="color: #11740a; font-style: italic;">// The omitted code should determine whether to reject the location update for being too</span>
    <span style="color: #11740a; font-style: italic;">// old, too close to the previous one, too inaccurate and so forth according to your own</span>
    <span style="color: #11740a; font-style: italic;">// application design.</span>
&nbsp;
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>isInBackground<span style="color: #002200;">&#41;</span>
    <span style="color: #002200;">&#123;</span>
        <span style="color: #002200;">&#91;</span>self sendBackgroundLocationToServer<span style="color: #002200;">:</span>newLocation<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#125;</span>
    <span style="color: #a61390;">else</span>
    <span style="color: #002200;">&#123;</span>
        <span style="color: #11740a; font-style: italic;">// ...</span>
    <span style="color: #002200;">&#125;</span>
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>OK, so now to the crux of it all. If we are running in the background, we can&#8217;t just use the network as we would normally. In background mode the iOS controls very strictly what is allowed, and for how long it is allowed, so if we were just to send the location to our server as normal, we will find this will be highly unreliable. It may work sometimes, it may not, and you will have no control over what is going on.</p>
<p>We can however TELL the operating system in advance that we are doing a background task that should be allowed to run to completion. By doing this, we can ensure that our network activity is given enough time to complete and so the remote server will get the location updates OK.</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><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> sendBackgroundLocationToServer<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CLLocation <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>location
<span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">// REMEMBER. We are running in the background if this is being executed.</span>
    <span style="color: #11740a; font-style: italic;">// We can't assume normal network access.</span>
    <span style="color: #11740a; font-style: italic;">// bgTask is defined as an instance variable of type UIBackgroundTaskIdentifier</span>
&nbsp;
    <span style="color: #11740a; font-style: italic;">// Note that the expiration handler block simply ends the task. It is important that we always</span>
    <span style="color: #11740a; font-style: italic;">// end tasks that we have started.</span>
&nbsp;
    bgTask <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span>
               beginBackgroundTaskWithExpirationHandler<span style="color: #002200;">:</span>
               <span style="color: #002200;">^</span><span style="color: #002200;">&#123;</span>
                   <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#125;</span> endBackgroundTask<span style="color: #002200;">:</span>bgTask<span style="color: #002200;">&#93;</span>;
                <span style="color: #002200;">&#125;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #11740a; font-style: italic;">// ANY CODE WE PUT HERE IS OUR BACKGROUND TASK</span>
&nbsp;
    <span style="color: #11740a; font-style: italic;">// For example, I can do a series of SYNCHRONOUS network methods (we're in the background, there is</span>
    <span style="color: #11740a; font-style: italic;">// no UI to block so synchronous is the correct approach here).</span>
&nbsp;
    <span style="color: #11740a; font-style: italic;">// ...</span>
&nbsp;
    <span style="color: #11740a; font-style: italic;">// AFTER ALL THE UPDATES, close the task</span>
&nbsp;
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>bgTask <span style="color: #002200;">!=</span> UIBackgroundTaskInvalid<span style="color: #002200;">&#41;</span>
    <span style="color: #002200;">&#123;</span>
        <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#125;</span> endBackgroundTask<span style="color: #002200;">:</span>bgTask<span style="color: #002200;">&#93;</span>;
        bgTask <span style="color: #002200;">=</span> UIBackgroundTaskInvalid;
    <span style="color: #002200;">&#125;</span>
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>The key to this whole process is the use of background tasks to ensure that our synchronous network activity is given enough time to complete. This lets us update a couch database for example where we might need to make 1 network call to get the current document revision and then a second network call to actually PUT the new data.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mindsizzlers.com/2011/07/ios-background-location/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Viewing iFolder&#8217;s FLAIM store with StoreBrowser</title>
		<link>http://www.mindsizzlers.com/2011/04/viewing-ifolders-flaim-store-with-storebrowser/</link>
		<comments>http://www.mindsizzlers.com/2011/04/viewing-ifolders-flaim-store-with-storebrowser/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 16:11:38 +0000</pubDate>
		<dc:creator>Roger</dc:creator>
				<category><![CDATA[iFolder]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[ifolder]]></category>

		<guid isPermaLink="false">http://www.mindsizzlers.com/?p=611</guid>
		<description><![CDATA[In the midst of debugging login issues with Novell&#8217;s iFolder, I stumbled over this post about a tool for accessing the FLAIM database that underpins the whole system. One of the problems is that the tool itself seems to have vanished from the trunk repository and so its existence was not at all obvious. There [...]]]></description>
			<content:encoded><![CDATA[<p>In the midst of debugging login issues with Novell&#8217;s iFolder, <a href="http://community.ifolder.com/ssf/a/do?p_name=ss_forum&amp;p_action=1&amp;title=debugging&amp;binderId=1487&amp;action=view_folder_entry&amp;page_title=Debugging&amp;vibeonprem_url=1">I stumbled over this post</a> about a tool for accessing the FLAIM database that underpins the whole system.</p>
<p>One of the problems is that the tool itself seems to have vanished from the trunk repository and so its existence was not at all obvious. There seem to be a few people having problems finding it and so I thought it worthwhile <a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Store-Browser.zip">including the storebrowser files here</a> so that you can get up and running more easily.</p>
<p>I&#8217;m going to document running StoreBrowser on your SERVER first. I&#8217;m assuming that you have a standard installation running on OpenSUSE 11.3 as that seems the best open source option at the current time (April 2011).</p>
<p>1) <a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Store-Browser.zip">Download the zip package</a> and unzip to a suitable location on your system.</p>
<p>2) Open a terminal window and navigate to the folder containing the StoreBrowser.exe file. <strong>It is important</strong> that you cd to this location as otherwise you will not be able to run it correctly.</p>
<p>3) Copy the asmx file to the appropriate place. This is OS specific and this guide is for OpenSUSE 11.3</p>
<p><strong>cp SimiasBrowser.asmx /usr/lib/simias/web/</strong></p>
<p>4) Ensure you have the directory ~/.local/share/ <strong>you may well need to mkdir ~/.local and then mkdir ~/.local/share .</strong>This location is used by the application to store its config data and it won&#8217;t auto create it, it will just complain.</p>
<p>5) if  echo $DISPLAY shows nothing in your terminal, enter the following command</p>
<p><strong>export DISPLAY=:0.0</strong></p>
<p>It is important to set the display otherwise mono will abort with an error like this;</p>
<p>Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI &#8212;&gt; System.ArgumentNullException: Could not open display (X-Server required. Check you DISPLAY environment variable)</p>
<p>6) <strong>mono StoreBrowser.exe</strong></p>
<p>If all is well, the application should launch with an empty window. First click on file and select Open Store as shown below;</p>
<p><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-16.43.27.png"><img class="alignnone size-full wp-image-615" title="Screen shot 2011-04-26 at 16.43.27" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-16.43.27.png" alt="" width="576" height="433" /></a></p>
<p>After selecting Open Store, you will need to enter the url for the local simias store. For example this will typically be http://localhost/simias10</p>
<p><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-16.44.10.png"><img class="alignnone size-full wp-image-616" title="Screen shot 2011-04-26 at 16.44.10" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-16.44.10.png" alt="" width="557" height="414" /></a></p>
<p>Click on OK and assuming all is well, you will be prompted to login. You need to enter your ADMIN username and password in order to access the store, normal user accounts won&#8217;t do.</p>
<p><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-16.44.28.png"><img class="alignnone size-full wp-image-617" title="Screen shot 2011-04-26 at 16.44.28" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-16.44.28.png" alt="" width="557" height="414" /></a></p>
<p>Once logged in, you will see the store tree to the left, however there is actually more to see but it&#8217;s hidden to the right of the window. To make it visible, drag the bottom right corner of the application window to enlarge it, and then drag to the left the dividing line that you will be able to see when you enlarge the frame.</p>
<p>You should end up with something that looks like this;</p>
<p><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-16.45.27.png"><img class="alignnone size-full wp-image-619" title="Screen shot 2011-04-26 at 16.45.27" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-16.45.27.png" alt="" width="557" height="414" /></a></p>
<p>If you expand the Store and select an entry, you will get screens like this;</p>
<p><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-16.45.56.png"><img class="alignnone size-full wp-image-614" title="Screen shot 2011-04-26 at 16.45.56" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-16.45.56.png" alt="" width="557" height="414" /></a></p>
<p>You can edit items by double clicking them. BUT FIRST A WARNING. <strong>MAKING ANY CHANGES TO A LIVE SYSTEM COULD RESULT IN THE LOSS OF YOUR DATA</strong>. This is a low level debugging tool that should be wielded by experts (feel free to get in touch if you know any!) and making changes could leave your system in an unstable state. Don&#8217;t go editing and deleting things and then complain to me afterwards that all your users have lost their data &#8230; it will be your fault not mine.</p>
<p>Don&#8217;t say I didn&#8217;t warn you &#8230;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mindsizzlers.com/2011/04/viewing-ifolders-flaim-store-with-storebrowser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iFolder on VirtualBox (part one)</title>
		<link>http://www.mindsizzlers.com/2011/04/ifolder-on-virtualbox-part-one/</link>
		<comments>http://www.mindsizzlers.com/2011/04/ifolder-on-virtualbox-part-one/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 15:20:34 +0000</pubDate>
		<dc:creator>Roger</dc:creator>
				<category><![CDATA[iFolder]]></category>
		<category><![CDATA[ifolder]]></category>

		<guid isPermaLink="false">http://www.mindsizzlers.com/?p=587</guid>
		<description><![CDATA[Today I&#8217;m going to put together a complete walk through for getting your very own iFolder server up and running on a virtual host on your Apple Mac.  iFolder is notoriously difficult to install but thanks to Daniel Lench, there is now an excellent tutorial over on his blog. I&#8217;m taking it a tiny step [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;m going to put together a complete walk through for getting your very own iFolder server up and running on a virtual host on your Apple Mac.  iFolder is notoriously difficult to install but thanks to <a href="http://www.daniellench.com/2010/08/ifolder-on-opensuse-11-3/">Daniel Lench, there is now an excellent tutorial over on his blog</a>.</p>
<p>I&#8217;m taking it a tiny step further by documenting the process with screengrabs and showing how you can do this with Oracle&#8217;s VirtualBox.  We chose Virtualbox over VMWare because on the Apple Mac, VMWare Fusion is not free whereas Virtualbox is. The instructions for VMWare would be different, but the intent would be the same.</p>
<p>&nbsp;</p>
<div id="attachment_589" class="wp-caption alignnone" style="width: 542px"><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.52.17.png"><img class="size-full wp-image-589 " title="Screen shot 2011-04-26 at 14.52.17" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.52.17.png" alt="" width="532" height="330" /></a><p class="wp-caption-text">Click on New to create a new virtual system</p></div>
<p>&nbsp;</p>
<p>Fire up virtualbox and click on the blue NEW icon to start the process of creating a new virtual system.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_590" class="wp-caption alignnone" style="width: 511px"><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.52.30.png"><img class="size-full wp-image-590 " title="Screen shot 2011-04-26 at 14.52.30" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.52.30.png" alt="" width="501" height="320" /></a><p class="wp-caption-text">Click Continue</p></div>
<p>&nbsp;</p>
<div id="attachment_591" class="wp-caption alignnone" style="width: 511px"><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.53.13.png"><img class="size-full wp-image-591 " title="Screen shot 2011-04-26 at 14.53.13" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.53.13.png" alt="" width="501" height="320" /></a><p class="wp-caption-text">Give it a name and ensure you choose Linux / OpenSuse</p></div>
<p>&nbsp;</p>
<div id="attachment_592" class="wp-caption alignnone" style="width: 511px"><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.53.26.png"><img class="size-full wp-image-592 " title="Screen shot 2011-04-26 at 14.53.26" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.53.26.png" alt="" width="501" height="320" /></a><p class="wp-caption-text">The default RAM is tight, but OK for this demo. Increase it on a real deployment.</p></div>
<p>&nbsp;</p>
<div id="attachment_593" class="wp-caption alignnone" style="width: 511px"><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.53.39.png"><img class="size-full wp-image-593 " title="Screen shot 2011-04-26 at 14.53.39" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.53.39.png" alt="" width="501" height="320" /></a><p class="wp-caption-text">Click Continue</p></div>
<p>&nbsp;</p>
<p>Now we will be asked about the virtual hard drive we will need.</p>
<p>&nbsp;</p>
<div id="attachment_594" class="wp-caption alignnone" style="width: 434px"><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.53.44.png"><img class="size-full wp-image-594" title="Screen shot 2011-04-26 at 14.53.44" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.53.44.png" alt="" width="424" height="299" /></a><p class="wp-caption-text">Continue</p></div>
<p>&nbsp;</p>
<div id="attachment_595" class="wp-caption alignnone" style="width: 434px"><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.54.00.png"><img class="size-full wp-image-595 " title="Screen shot 2011-04-26 at 14.54.00" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.54.00.png" alt="" width="424" height="299" /></a><p class="wp-caption-text">Continue</p></div>
<p>&nbsp;</p>
<div id="attachment_596" class="wp-caption alignnone" style="width: 434px"><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.54.43.png"><img class="size-full wp-image-596 " title="Screen shot 2011-04-26 at 14.54.43" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.54.43.png" alt="" width="424" height="299" /></a><p class="wp-caption-text">Continue</p></div>
<p>&nbsp;</p>
<div id="attachment_597" class="wp-caption alignnone" style="width: 434px"><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.55.00.png"><img class="size-full wp-image-597 " title="Screen shot 2011-04-26 at 14.55.00" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.55.00.png" alt="" width="424" height="299" /></a><p class="wp-caption-text">Done</p></div>
<p>&nbsp;</p>
<p>Now we are asked to confirm the virtual machine we are going to create.</p>
<p>&nbsp;</p>
<div id="attachment_598" class="wp-caption alignnone" style="width: 511px"><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.55.08.png"><img class="size-full wp-image-598 " title="Screen shot 2011-04-26 at 14.55.08" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.55.08.png" alt="" width="501" height="320" /></a><p class="wp-caption-text">Done</p></div>
<p>&nbsp;</p>
<p>And we&#8217;re done &#8230; or rather we now have an empty virtual machine that we can install the base operating system onto and then begin setting up for iFolder.</p>
<p>&nbsp;</p>
<div id="attachment_599" class="wp-caption alignnone" style="width: 542px"><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.55.29.png"><img class="size-full wp-image-599 " title="Screen shot 2011-04-26 at 14.55.29" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.55.29.png" alt="" width="532" height="330" /></a><p class="wp-caption-text">And there it is ... </p></div>
<p>&nbsp;</p>
<p>It&#8217;s important to note at this stage that we are yet to put an operating system onto our virtual machine, and before we do that, we need to have some installation disks available.</p>
<p>iFolder is currently not qualified for OpenSUSE 11.4, so we need to download an installer for OpenSUSE 11.3 which we can grab from <a href="http://software.opensuse.org/113/en">software.opensuse.org/113/en</a> it is a big download, so kick it off and make yourself a nice cup of tea!</p>
<div id="attachment_608" class="wp-caption alignnone" style="width: 522px"><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/opensuse.png"><img class="size-full wp-image-608" title="opensuse" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/opensuse.png" alt="" width="512" height="384" /></a><p class="wp-caption-text">Download the DVD and make some tea!</p></div>
<p>&nbsp;</p>
<p>Once you have the ISO on your computer, we can fire up the virtual machine and install OpenSUSE onto it.  So first of all START the virtual machine we have just built and we&#8217;ll get the first run wizard.</p>
<p>&nbsp;</p>
<div id="attachment_600" class="wp-caption alignnone" style="width: 438px"><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.55.57.png"><img class="size-full wp-image-600 " title="Screen shot 2011-04-26 at 14.55.57" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.55.57.png" alt="" width="428" height="304" /></a><p class="wp-caption-text">Continue</p></div>
<p>&nbsp;</p>
<div id="attachment_601" class="wp-caption alignnone" style="width: 438px"><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.56.09.png"><img class="size-full wp-image-601 " title="Screen shot 2011-04-26 at 14.56.09" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.56.09.png" alt="" width="428" height="304" /></a><p class="wp-caption-text">Click the folder icon so we can browse to our ISO</p></div>
<p>&nbsp;</p>
<p>Navigate to where our newly downloaded ISO file is.</p>
<p>&nbsp;</p>
<div id="attachment_602" class="wp-caption alignnone" style="width: 451px"><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.56.25.png"><img class="size-full wp-image-602 " title="Screen shot 2011-04-26 at 14.56.25" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.56.25.png" alt="" width="441" height="314" /></a><p class="wp-caption-text">Navigate then click Open</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_603" class="wp-caption alignnone" style="width: 438px"><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.56.34.png"><img class="size-full wp-image-603 " title="Screen shot 2011-04-26 at 14.56.34" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.56.34.png" alt="" width="428" height="304" /></a><p class="wp-caption-text">Continue</p></div>
<p>&nbsp;</p>
<div id="attachment_604" class="wp-caption alignnone" style="width: 438px"><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.56.40.png"><img class="size-full wp-image-604 " title="Screen shot 2011-04-26 at 14.56.40" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.56.40.png" alt="" width="428" height="304" /></a><p class="wp-caption-text">Done</p></div>
<p>&nbsp;</p>
<p>Our virtual machine will now launch, boot from the virtual install DVD and we can begin the installation proper.</p>
<p>&nbsp;</p>
<div id="attachment_588" class="wp-caption alignnone" style="width: 514px"><a href="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.58.40.png"><img class="size-full wp-image-588 " title="Screen shot 2011-04-26 at 14.58.40" src="http://www.mindsizzlers.com/wp-content/uploads/2011/04/Screen-shot-2011-04-26-at-14.58.40.png" alt="" width="504" height="410" /></a><p class="wp-caption-text">Select Installation and off we go ...</p></div>
<div>
<dl id="attachment_600"></dl>
</div>
<p>Rather than duplicate the official guide on how to proceed from here, I&#8217;m going to hand you over to the experts at Novell who have already prepared a full walk through on the simple installation procedure.  <a href="http://www.novell.com/documentation/opensuse113/book_quickstarts/?page=/documentation/opensuse113/book_quickstarts/data/art_osuse_installquick_113.html">The complete OpenSUSE installation guide for 11.3 can be found here.</a></p>
<p>In the next part, I&#8217;ll show you how to install the pre-requisites that you are going to need in order to install iFolder.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mindsizzlers.com/2011/04/ifolder-on-virtualbox-part-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iFolder for iPhone now available!</title>
		<link>http://www.mindsizzlers.com/2011/01/ifolder-for-iphone-now-in-beta/</link>
		<comments>http://www.mindsizzlers.com/2011/01/ifolder-for-iphone-now-in-beta/#comments</comments>
		<pubDate>Wed, 12 Jan 2011 22:12:09 +0000</pubDate>
		<dc:creator>Roger</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[ifolder]]></category>

		<guid isPermaLink="false">http://www.mindsizzlers.com/?p=580</guid>
		<description><![CDATA[UPDATE: The first release is now available in the app store. At the moment it&#8217;s US only but we expect to do a global release by the end of February 2011. We&#8217;ve just put the finishing touches to our iFolder for iPhone app and are recruiting enterprise beta testers who have their own iFolder installation. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE: The first release is now available in the app store. At the moment it&#8217;s US only but we expect to do a global release by the end of February 2011.</strong></p>
<p><a href="http://itunes.apple.com/us/app/ifolder/id411688812?mt=8"><img class="alignnone" src="http://app.golden-hour.com/wp-content/uploads/2010/10/App_Store_Badge_EN.png" alt="Available in the US App Store" width="200" height="100" /></a></p>
<p>We&#8217;ve just put the finishing touches to our iFolder for iPhone app and are recruiting enterprise beta testers who have their own iFolder installation. The easiest way of describing iFolder is probably to say that it&#8217;s dropbox for the enterprise &#8211; it&#8217;s a cross-platform secure file sharing system originally developed by Novell and now open sourced. There are existing open source clients for Windows, Apple Mac and Linux, but mobile support is currently limited (well, non-existent).</p>
<p>You can check out the app and apply for the beta programme over at <a href="http://ifolder.mindsizzlers.com">ifolder.mindsizzlers.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mindsizzlers.com/2011/01/ifolder-for-iphone-now-in-beta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Page Speed</title>
		<link>http://www.mindsizzlers.com/2010/12/google-page-speed/</link>
		<comments>http://www.mindsizzlers.com/2010/12/google-page-speed/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 09:23:09 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.mindsizzlers.com/?p=570</guid>
		<description><![CDATA[In April 2010, Google made an announcement that they were including web page loading speed as a metric for page rank. This reiterates the importance of having strong technical skills to hand in achieving SEO. At the same time, Google offered a number of tools to help webmasters achieve faster page loading times. One of [...]]]></description>
			<content:encoded><![CDATA[<p>In April 2010, <a href="http://googlewebmastercentral.blogspot.com/2010/04/using-site-speed-in-web-search-ranking.html" target="_blank">Google made an announcement</a> that they were including web page loading speed as a metric for page rank.  This reiterates the importance of having strong technical skills to hand in achieving SEO.  At the same time, Google offered a number of tools to help webmasters achieve faster page loading times.</p>
<p>One of these tools is a <a href="http://code.google.com/speed/page-speed/docs/extension.html" target="_blank">browser plugin for Firefox/Firebug</a>, once installed you access the information from the Firebug console.  Page Speed rates elements of your page, how quickly it loads and offers advice on how to speed it up.  This includes tips such as minifying JS and CSS, serving static content from cookieless domains, putting JS and CSS in the right order in your pages and so on and hundreds of other rules.  There have been other such plugins available before, such as <a href="http://developer.yahoo.com/yslow/" target="_blank">Yahoo&#8217;s YSlow</a> which does much the same although both can be used in conjunction with each other as they cover slightly different rule sets.</p>
<p>The other &#8216;tool&#8217; that Google offer is <a href="http://code.google.com/speed/page-speed/docs/module.html" target="_blank">an Apache module, mod_pagespeed</a>, that actually does a lot of rewriting on the way out.  The module works only for Apache 2.2+ and can be configured to make a lot of the changes that are recommended by the plugin.  For example, it can strip whitespace out of files it serves, minifies JS and CSS, can reduce images, serve images as inline data:// and do all manner of other things.</p>
<p>Installing mod_pagespeed on Debian or Ubuntu proves pretty straightforward.  The steps, as root on a 32 bit system, are:-</p>
<p><code>wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_i386.deb<br />
dpkg -i mod-pagespeed*.deb<br />
apt-get -f install</code></p>
<p>Once installed, you can configure the module:-</p>
<p><code>vi /etc/apache2/mods-available/pagespeed.conf<br />
</code></p>
<p>By default, very little change is made to your serving environment but you can add in &#8216;filters&#8217; to the config file.  For example, to have the server combine all CSS files into a single file, add the filter:</p>
<p><code>ModPagespeedEnableFilters combine_css<br />
</code></p>
<p>To minify CSS, add this filter:-</p>
<p><code>ModPagespeedEnableFilters rewrite_css</code></p>
<p>After installation and any configuration changes you must restart Apache and straight away you will see the results, with pages being rewritten on the fly to reduce the amount of data being transferred and the number of round trips to the server.  Familiarise yourself with <a href="http://code.google.com/speed/page-speed/docs/filters.html" target="_blank">the different filters available for mod_pagespeed</a> and make sure that you configure the module in the way that you wish.  Be aware that each module carries an element of risk which is outlined in the documentation.  For example, some of the page rewriting may break your pages if you walk the DOM using an expected structure rather than dynamically.  Risks associated with each filter are clearly outlined and you must decide whether each is likely to cause problems on your site.</p>
<p>mod_pagespeed is still only in Beta, it was only launched in November 2010 so this is still early days, but our experience with this module shows that it is a good weapon to add to the SEO arsenal, provided you are running Apache 2.2, and webmasters should welcome it, particularly in environments where there are many developers contributing to web content, some of whom may not have much of an insight into optimising pages.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mindsizzlers.com/2010/12/google-page-speed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing Apps for iPhone OS3, 3.2 and iOS4</title>
		<link>http://www.mindsizzlers.com/2010/07/writing-apps-for-iphone-os3-and-ios4/</link>
		<comments>http://www.mindsizzlers.com/2010/07/writing-apps-for-iphone-os3-and-ios4/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 14:15:14 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[device]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[os]]></category>
		<category><![CDATA[os version]]></category>
		<category><![CDATA[respondstoselector]]></category>

		<guid isPermaLink="false">http://www.mindsizzlers.com/?p=556</guid>
		<description><![CDATA[The recent launches of iPad and iPhone4 have led to a flurry of activity on the iPhone operating system front. iPad launched with iPhone OS 3.2 but this OS was never destined for iPhone itself. iPhone 4 has introduced another OS release, with a nameshift from &#8216;iPhone OS&#8217; to &#8216;iOS&#8217; 4. iPhone and iPod users [...]]]></description>
			<content:encoded><![CDATA[<p>The recent launches of iPad and iPhone4 have led to a flurry of activity on the iPhone operating system front.  iPad launched with iPhone OS 3.2 but this OS was never destined for iPhone itself.  iPhone 4 has introduced another OS release, with a nameshift from &#8216;iPhone OS&#8217; to &#8216;iOS&#8217; 4.  iPhone and iPod users are expected to migrate to iOS 4, but the upgrade isn&#8217;t mandatory.  Eventually no doubt the iPad will join iPhone on a universal OS, in the meantime, you&#8217;re likely to find that your having to support three, and maybe more, different versions of the OS, across various devices.</p>
<p>When you&#8217;re coding for a specific OS, you should not look at the version number and base your logic on that.  Here is an example of what to avoid:-</p>
<pre>if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 3.2)
        { /* do iPad stuff here */ }
    else
        { /* do iPhone stuff here */ }
</pre>
<p>Whilst that is a perfectly legitimate way to be looking up the OS version, in reality you are less interested in the OS version per se so much as the capabilities of the underlying OS.  Code that might work today can easily break.  Here for example, you iPad intended code is going to run on iPhone&#8217;s upgraded to iOS4.</p>
<p>Instead, you should use the class method available to NSObject and all descendants:-</p>
<p><code>+(BOOL) instancesRespondToSelector: (SEL) aSelector</code></p>
<p>So you could write, for example:-</p>
<pre>if ([[UIApplication sharedApplication] respondsToSelector: @selector(setStatusBarHidden: withAnimation:)])
        { [[UIApplication sharedApplication] setStatusBarHidden: YES withAnimation: UIStatusBarAnimationFade]; }
    else
        { [[UIApplication sharedApplication] setStatusBarHidden: YES animated: YES]; }
</pre>
<p>Here we test whether we use the method <code>setStatusBarHidden:</code> or the newer method <code>setStatusBarHidden: withAnimation:</code>.  This will compile and run under different OS versions and give us the required means to act according to OS capabilities.</p>
<p>This test can be particularly important when writing for newer version of the OS but looking to support older ones.  Occasionally additional classes and methods that have previously been private are promoted to public use and are documented, but using these under older OS&#8217;s will still trigger the automatic rejection for using undocumented methods in the Cocoa Touch libraries.  For example, UINib is a new class made available in iOS 4.0 for working with cached NIB files.  Although this class was always there, it used to be out of bounds.  Using this class in an app written for iPhone OS 3.x will lead to rejection.  Testing methods for this class with &#8216;respondsToSelector&#8217; will only return true if the method is public and you are entitled to work with it.</p>
<p>If you are looking to change screen layouts or other functionality depending on the actual device, Apple have created a new property of a UIDevice object.  This macro will test whether you are on an iPad (UIUserInterfaceIdiomPad) or iPhone/iPod Touch (UIUserInterfaceIdiomPhone).</p>
<pre>if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
     {     /* The device is an iPad running iPhone 3.2 or later. */ }
else
      {  /* The device is an iPhone or iPod touch. */ }
</pre>
<p>Wrap this around views where you want to achieve different layouts according to the screen sizes, and anywhere else that you have iPad specific behaviour.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mindsizzlers.com/2010/07/writing-apps-for-iphone-os3-and-ios4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Delegation and Notifications, Oddities or Pure Elegance?</title>
		<link>http://www.mindsizzlers.com/2010/06/delegation-and-notifications-oddities-or-pure-elegance/</link>
		<comments>http://www.mindsizzlers.com/2010/06/delegation-and-notifications-oddities-or-pure-elegance/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 00:04:04 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[delegates]]></category>
		<category><![CDATA[delegation]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[notification centre]]></category>
		<category><![CDATA[notifications]]></category>

		<guid isPermaLink="false">http://www.mindsizzlers.com/?p=550</guid>
		<description><![CDATA[Objective-C and Cocoa Touch are strong on design patterns and principles. If you adhere to Apple&#8217;s way of coding then you&#8217;ll create reliable and reusable code. If you&#8217;re new to Objective-C, some of the design principles can be quite daunting and if your background is in other object oriented languages, some of the design patterns [...]]]></description>
			<content:encoded><![CDATA[<p>Objective-C and Cocoa Touch are strong on design patterns and principles.  If you adhere to Apple&#8217;s way of coding then you&#8217;ll create reliable and reusable code.  If you&#8217;re new to Objective-C, some of the design principles can be quite daunting and if your background is in other object oriented languages, some of the design patterns may initially appear quite alien.</p>
<p>Delegation and notifications present two such slightly odd patterns, but once you understand them they are actually rather elegant in what they achieve.</p>
<p><strong>Delegation</strong></p>
<p>Most people describe delegation as a method of subclassing, and essentially that&#8217;s right.  Delegation wouldn&#8217;t exist though if it were simply an alternative to subclassing, so you can be sure that it solves other problems.  I like to think of delegation almost as a <em>work in progress</em> &#8211; a class knows what it has to achieve and is implemented accordingly, but delegation allows a broad class to be written in such a way as to leave the final detail to future imagination.  This is achieved by assigning your object as a delegate to a predisposed object; your new object can implement a bunch of methods that will be called by the delegating object whilst benefiting from the much broader underlying library.</p>
<p>The most common use of delegation must be handling UITableViews.  The core Cocoa Touch library implements nearly everything a table requires in order to handle display itself, but how the cells are laid out, how your app responds to touches and so on is all left to your implementation.  Most of the table handling code is given and you need not concern yourself to the inner workings, but you have to complete the final part &#8211; you must define how many sections there are in your table, how many cells in each section, how each cell will be laid out, whether there is a disclosure button and what should happen if the table is selected.  All of this behaviour is defined by you &#8211; you are offered templated &#8216;hooks&#8217; that you can fill in or remove depending on how you want your actual implementation to behave.  Sometimes delegate methods are required to be completed, other times they are optional.</p>
<p>Cocoa Touch uses delegation extensively, indeed the main application is executed via delegation, hence your appDelegate.  You&#8217;ll come across delegation in many other situations as you start creating apps for the iPhone and iPad.</p>
<p><strong>Notifications</strong></p>
<p>Another peculiar design pattern in Objective-C is that of notifications &#8211; that&#8217;s NSNotifications, not the more recently implemented Push Notifications.  Notifications are very different to delegation and yet they share a common goal &#8211; both offer a way for remote classes to interact with your own objects.</p>
<p>An app has a &#8216;notification centre&#8217; that is like a central switchboard within your app.  Any method can send notices to the notification centre as it does its work.  Any object can &#8216;tune in&#8217; to the notification centre, choosing to listen to all broadcasts, or just to notices relating to particular topics.  The API&#8217;s that you use with Cocoa Touch broadcast messages extensively in the background.  You won&#8217;t be aware of this until you subscribe to notifications, and suddenly you&#8217;ll be inundated with reams of information as your app goes about its duties!</p>
<p>You can take advantages of notifications by responding to events that you wouldn&#8217;t otherwise have visibility of.  For example, MPMoviePlayerController prior to iPhone OS 3.2 gave almost no access to know when a movie was stopped, started or when other buttons were pressed.  Monitoring when a movie was stopped was widely documented &#8211; you subscribed to the relevant notification that the movie had stopped.  But you could also subscribe to other notifications for other events triggered by the player controller and implement your application&#8217;s response accordingly.</p>
<p>In the same way that delegates can be used for a remote object to call a method on your own object, so notifications can be used as a way of triggering methods in your classes from a remote object.  Whilst delegates can only have one object respond to them, notifications allow for many objects all to respond to a single event.  Beware if you are working in a multithreaded environment because you can only subscribe to notices broadcast within your own thread.</p>
<p><strong>Final Words</strong></p>
<p>Delegation and notifications offer two design patterns used widely in Cocoa Touch, there are many more besides.  All in all they each offer a distinct way of achieving some task; on the whole they add flexibility to  the main workings of many of the Cocoa API&#8217;s, decoupling the bulk of the workings from the finer implementation.  Often they allow the programmer to achieve some monumental tasks in just a few lines of code.  How many lines of code to implement a table?  &#8230;now consider how easily you could do it just using views and subviews and coding it from scratch!</p>
<p>Delegates and notifications are not the exclusive preserve of Apple &#8211; you too can create your own delegates and fire your own messages to the notification centre.  Once you are familiar with Apple&#8217;s design patterns, perhaps you will adopt best practice and model them in your own classes?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mindsizzlers.com/2010/06/delegation-and-notifications-oddities-or-pure-elegance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Apps vs. Native Apps</title>
		<link>http://www.mindsizzlers.com/2010/05/web-apps-vs-native-apps/</link>
		<comments>http://www.mindsizzlers.com/2010/05/web-apps-vs-native-apps/#comments</comments>
		<pubDate>Fri, 21 May 2010 10:06:19 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[hybrid apps]]></category>
		<category><![CDATA[native apps]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[training]]></category>
		<category><![CDATA[web apps]]></category>

		<guid isPermaLink="false">http://www.mindsizzlers.com/?p=446</guid>
		<description><![CDATA[When the iPhone was first launched, it didn&#8217;t launch with a marketplace for apps &#8211; indeed Apple didn&#8217;t even enable programmers to create applications for the platform at all. Quite quickly though, people worked out that you could create a web based application and style it specially to run in the iPhone screen. The Web [...]]]></description>
			<content:encoded><![CDATA[<p>When the iPhone was first launched, it didn&#8217;t launch with a marketplace for apps &#8211; indeed Apple didn&#8217;t even enable programmers to create applications for the platform at all.  Quite quickly though, people worked out that you could create a web based application and style it specially to run in the iPhone screen.  The Web App was born, and Apple quickly embraced this entrepreneurial approach by setting up a <a href="http://www.apple.com/webapps/" target='_new'>Web App directory</a>.  To have an app listed you just have to submit your URL to Apple and if it conforms to their loose rules and guidelines, it will be added to their listings.</p>
<p>The iPhone runs a very competent and capable Safari web browser which supports current web standards.  Interactivity can be achieved using Javascript, there are even a few proprietary extensions to HTML and Javascript (undergoing formal approval to become standards) to cater for some of the capabilities of a touch and multitouch environment.</p>
<p>With the success of Web Apps, Apple took the bold decision to open up the iPhone platform to any programmer, making the SDK freely available, introducing a nominal fee to join their developer program, adding app support into iTunes and introducing a revenue-share model for app publishers.  This was a game changing move which other mobile platforms have tried to replicate with mixed results.</p>
<p>Native applications are written in Objective-C, a superset of C and C++, and the SDK includes hundreds of API&#8217;s and libraries that allow any programmer to create the true &#8216;iPhone experience&#8217; for their own applications.  There&#8217;s a steep learning curve for anyone that hasn&#8217;t developed for the Mac platform before, but it&#8217;s a rewarding experience &#8211; Objective-C is an elegant language and the rich SDK often makes complex tasks relatively straightforward.</p>
<p>Programmers can still create web applications in favour of native applications, and if you don&#8217;t want formal listing in the app store or the web app directory, then there are no restrictions on what your app can do, how it behaves or on your business model &#8211; you can encourage people to add your app to their iPhone from your own website.  However, you cannot recreate the rich experience of native applications, and such apps require an internet connection at all times.  Much of the iPhone experience is down to the <em>Wow factor</em> given by:- </p>
<ul>
<li>the animated interface</li>
<li>tab and navigation controllers</li>
<li>access to the camera, contacts and iTunes library</li>
<li>access to location information, compass data and movement data from the accelerometer</li>
</ul>
<p>Most of this can only be replicated in a web app in a &#8216;hacky&#8217; way that won&#8217;t make your app stand out, and doesn&#8217;t do the platform justice.</p>
<p>You can create &#8216;hybrid&#8217; applications for the iPhone and many apps in the store take this approach.  They take advantage of the native SDK to give the app the overall iPhone navigational experience, but they are filled with HTML content, either stored locally or on a remote web server.  If your company has web content that you want embedded in your app, then this presents a great way to do this without having to maintain different information sources.  Beware that apps taking this approach may display no content if there isn&#8217;t an internet connection, and part of Apple&#8217;s requirement is that apps handle lack of internet connectivity gracefully.</p>
<p>The &#8216;hybrid&#8217; nature of such apps is achieved through a few simple mechanisms:</p>
<ul>
<li>A screen (view) can contain a web &#8216;canvas&#8217; (UIWebView) that you can populate with HTML, CSS and Javascript</li>
<li>The content of a UIWebView is addressed by a URN pointing to a local file or a remote resource</li>
<li>You can have multiple UIWebViews in a single screen (view)</li>
<li>Javascript can call out to Objective-C methods</li>
<li>Objective-C methods can call Javascript functions within a UIWebView</li>
</ul>
<p>Learning just enough Objective-C to enable you to build hybrid applications is a great first step to learning how to do much more.  At Mindsizzler&#8217;s we&#8217;re convinced that once you set out, you&#8217;ll enjoy the experience and will be thirsty to learn more!</p>
<p>If you need that introduction to learn how to create iPhone applications and achieve a good understanding of Objective-C, Xcode and the iPhone SDK then why not <a href="http://www.mindsizzlers.com/2010/04/iphone-training-courses/">join in one of our training courses</a>?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mindsizzlers.com/2010/05/web-apps-vs-native-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Objective-C and the Properties of BOOL</title>
		<link>http://www.mindsizzlers.com/2010/04/objective-c-and-the-properties-of-bool/</link>
		<comments>http://www.mindsizzlers.com/2010/04/objective-c-and-the-properties-of-bool/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 09:47:41 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[BOOL]]></category>
		<category><![CDATA[boolean]]></category>
		<category><![CDATA[false]]></category>
		<category><![CDATA[NO]]></category>
		<category><![CDATA[primitive type]]></category>
		<category><![CDATA[true]]></category>
		<category><![CDATA[YES]]></category>

		<guid isPermaLink="false">http://www.mindsizzlers.com/?p=405</guid>
		<description><![CDATA[At a basic level, boolean logic allows for a value to be either true or false, on or off, 1 or 0. The ways in which boolean types are implemented vary widely across languages and implementations. At the most granular level, computers work with bits that are either set to on or off, whereas some [...]]]></description>
			<content:encoded><![CDATA[<p>At a basic level, boolean logic allows for a value to be either true or false, on or off, 1 or 0.  The ways in which boolean types are implemented vary widely across languages and implementations.  At the most granular level, computers work with bits that are either set to on or off, whereas some boolean data types in databases cater for three or even four values: 1, 0, null or undefined.  Dennis Ritchie&#8217;s original C language lacked a boolean type at all but it was added in C99, and C&#8217;s primitive &#8216;bool&#8217; type is available in Objective-C.  &#8216;bool&#8217; can be set to either true or false, 1 or 0.</p>
<p>Objective-C has implemented a more standard boolean property &#8211; it offers the BOOL type in addition to the primitive &#8216;bool&#8217;.  The Cocoa and Cocoa Touch API&#8217;s use BOOL as the standard message response in favour of &#8216;bool&#8217;, so it is a property you must get to understand, and should code your own methods using BOOL as well.</p>
<p>Unlike most other things in Objective-C, BOOL is NOT an object, it is a raw data type.  The standard values of BOOL are YES and NO rather than true or false, or 1 or 0.  However, under the bonnet YES and NO are simply definitions given to the preprocessor as aliases for 1 and 0.  In Cocoa Touch YES and NO are defined in NSObjCRuntime.h:-</p>
<p><code>#if !defined(YES)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#define YES	(BOOL)1<br />
#endif<br />
</code></p>
<p><code>#if !defined(NO)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#define NO	(BOOL)0<br />
#endif</code></p>
<p>This means that BOOL values are NEVER &#8216;YES&#8217; and &#8216;NO&#8217; so you cannot test them as such:-</p>
<p><code>if (myBOOL == 'YES') { ... }</code></p>
<p>&#8230;and they are NOT objects, so you cannot send the message:-</p>
<p><code>if ([myBOOL isEqualToString: @"YES"]) { ... }</code></p>
<p>Instead you must test them for true or false, or zero or non-zero:-</p>
<p><code>if (myBOOL) { ... }</code></p>
<p>or </p>
<p><code>if (!myBOOL) { ... }</code></p>
<p>If you want to log the value of a BOOL property using NSLog, then you can use the decimal signed integer format identifier %d:-</p>
<p><code>NSLog(@"MyBOOL value is %d", myBOOL);</code></p>
<p>Because BOOL represents 1 and 0 internally, you can also use the ternary operator to test BOOL values:-</p>
<p><code>myBOOL ? NSLog(@"Yes") : NSLog(@"No");</code></p>
<p>&#8230;and you can use this technique to convert between bool and BOOL should you so wish:-</p>
<p><code>mybool = myBOOL ? true : false;</code></p>
<p>Remembering that BOOL is NOT an object type makes it easy to remember how to declare BOOL properties, namely:-</p>
<p><code>BOOL myBOOL = YES;</code></p>
<p>&#8230;rather than using a pointer:-</p>
<p><code>BOOL *myBOOL = YES;</code></p>
<p>BOOL properties can be set with any of YES / NO, true / false or 1 / 0.  All map back to 1 or 0.</p>
<p>Understanding that Objective-C&#8217;s BOOL data type is simply mapped to 1 and 0 makes working with BOOL values completely straightforward!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mindsizzlers.com/2010/04/objective-c-and-the-properties-of-bool/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>KVO and Bindings on iPhone</title>
		<link>http://www.mindsizzlers.com/2010/04/kvo-and-bindings-on-iphone/</link>
		<comments>http://www.mindsizzlers.com/2010/04/kvo-and-bindings-on-iphone/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 00:22:18 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[bindings]]></category>
		<category><![CDATA[key value coding]]></category>
		<category><![CDATA[key value observing]]></category>
		<category><![CDATA[kvc]]></category>
		<category><![CDATA[kvo]]></category>

		<guid isPermaLink="false">http://www.mindsizzlers.com/?p=360</guid>
		<description><![CDATA[&#8216;Google&#8217; for KVO and bindings for iPhone, and too many results tell you that KVO is not supported on the iPhone platform.  Well, if it wasn&#8217;t once, it is now, and it&#8217;s a really powerful feature.  KVO is Key-Value Observing &#8211; essentially you can add have one object &#8216;observe&#8217; changes to a property of another [...]]]></description>
			<content:encoded><![CDATA[<p><em>&#8216;Google&#8217; </em>for KVO and bindings for iPhone, and too many results tell you that KVO is not supported on the iPhone platform.  Well, if it wasn&#8217;t once, it is now, and it&#8217;s a really powerful feature.  KVO is Key-Value Observing &#8211; essentially you can add have one object &#8216;observe&#8217; changes to a property of another object.  When that property changes, a callback is fired and you can trigger an action.  In many respects it&#8217;s similar to delegation or notifications, in this instance allowing a callback event to be triggered by changes in your objects.</p>
<p>KVO is commonly used to bind your application data to the interface so that whenever your data changes, the interface is automatically updated to reflect the change.  Here&#8217;s an example: imagine that you are writing a game and your score is stored in a property.  Rather than looping continually and updating the score on every iteration, you can observe your score and every time it changes, trigger the display to update automatically.</p>
<p>There are countless uses for KVO, and once you understand how it works, you will probably start using it regularly in your applications.  KVO also helps to implement a clean MVC architecture, although the callback MUST be implemented, so your view controller does require some prior knowledge of the architecture.</p>
<p>Implementation is really straightforward, but you do need to understand key-value coding.  Key-value coding (KVC) offers a different way to access properties of an object.  You&#8217;re probably familiar with:-</p>
<pre>[anObject setProperty: @"Some string"];
&nbsp;
</pre>
<p>or:-</p>
<pre>anObject.property = @"Some string";
&nbsp;
</pre>
<p>KVC allows you to access an object property by using a key, thus:-</p>
<pre>[anObject setValue: @"Some string" forKey: @"property"];
&nbsp;
</pre>
<p>If you are writing your own accessors you MUST comply with traditional naming conventions (setter = setPropertyName, getter = propertyName) because KVC assumes the names based on the key.  If you only need standard accessors, you can synthesize your properties and KVO works fine.</p>
<p>If you&#8217;re comfortable with that, then setting an observer is as simple as:-</p>
<pre>[anObject addObserver:self forKeyPath:@"property" options: 0  context: NULL];
&nbsp;
</pre>
<p>&#8230;then when &#8216;property&#8217; in anObject is changed through the KVC method:</p>
<pre>[anObject setValue: @"Some string" forKey: @"property"];
&nbsp;
</pre>
<p>The observer fires an observer callback, passing in the key of the changed property.  By looking at the key value, you can trigger the appropriate work:-</p>
<pre>- (void) observeValueForKeyPath: (NSString *) keyPath ofObject: (id)  object
change: (NSDictionary *) change context: (void *) context {
     if ([keyPath isEqualToString:@"property"] ) {
         // update your interface or do something else here...
     }
}
&nbsp;
</pre>
<p>You MUST implement the <em>observeValueForKeyPath: ofObject: change: context:</em> method otherwise your app will crash.  <em>Change</em> allows you to access the old or new value, or both, and <em>context</em> allows you to pass in a pointer, enabling you to pass more information into your callback.</p>
<p>That&#8217;s pretty much all there is to KVO.  Observing can be quite resource intensive so try to avoid setting lots of observers.  If you want to track a lot of properties, look at implementing a single flag that can trigger work to update all of your properties.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mindsizzlers.com/2010/04/kvo-and-bindings-on-iphone/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.565 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-07 12:07:35 -->

