<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Mozketo</title>
	
	<link>http://mozketo.com</link>
	<description>Now a dev diary</description>
	<lastBuildDate>Fri, 13 Nov 2009 12:11:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/Mozketo" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Kindle in Australia</title>
		<link>http://feedproxy.google.com/~r/Mozketo/~3/GoXsL_VJV0E/</link>
		<comments>http://mozketo.com/kindle/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 12:04:01 +0000</pubDate>
		<dc:creator>Mozketo</dc:creator>
				<category><![CDATA[Kindle]]></category>

		<guid isPermaLink="false">http://mozketo.com/?p=257</guid>
		<description><![CDATA[Some thoughts on Kindle (International version) in Australia.
Screen
I absolutely love the sharpness of the text. It&#8217;s not pixelated or jaggy and to me mimics the look of printed text. Under sunlight the screen is easy to read (doesn&#8217;t wash out like LCD screens) and interestingly the more light the better the screen looks. 
The screen [...]]]></description>
			<content:encoded><![CDATA[<p>Some thoughts on Kindle (International version) in Australia.</p>
<p><strong>Screen</strong></p>
<p>I absolutely love the sharpness of the text. It&#8217;s not pixelated or jaggy and to me mimics the look of printed text. Under sunlight the screen is easy to read (doesn&#8217;t wash out like LCD screens) and interestingly the more light the better the screen looks. </p>
<p>The screen refresh is weird, not wrong, just weird. It flicks and redraws itself. I guess there&#8217;s time to turn a physical page anyway with traditional books/magazines.</p>
<p>The contrast of background to text colour is fine until you&#8217;re in low light situations and you find yourself drawn to light sources, as above the more light the better the reading.</p>
<p>The time for a page turn (aka screen refresh) makes web surfing nigh on impossible (a moot point here in Australia as browsing outside of the US is limited to wikipedia only).</p>
<p><strong>Killer features</strong></p>
<p>The inbuilt dictionary (displays at bottom of page when you select a word).<br />
The long battery life (48 hours and 2 notches down).<br />
Conversion from doc/pdf to Kindle (send from your email address to the kindle (fee) or back to your email client (free)) is nearly a killer feature (I wish for native PDF).<br />
Searching within a book.<br />
Downloading a book within 60 seconds.</p>
<p><strong>Weight, size and feel</strong></p>
<p>The size and weight are killer features also.</p>
<p>There&#8217;s a &#8220;chin&#8221; to the bottom of the product, where the keyboard buttons are. I originally though this was undesirable but lying in bed resting the &#8220;chin&#8221; of the Kindle on my chest and it dawns on me. The &#8220;chin&#8221; exists by design and props itself up making reading easier than a paper novel.</p>
<p>The keyboard isn&#8217;t the greatest, but you use it minimally making it not a show stopper.</p>
<p><strong>Audible, MP3, mobi files and text-to-speech</strong></p>
<p>Getting Audible/MP3 onto the Kindle is a breeze, you use the USB cable (supplied) and it&#8217;s mounted as a volume then just copy the audio files into the existing folder structure.</p>
<p>3.5mm headphone jack on top. Volume on side. Easy.</p>
<p>Text to speech is so-so as a plus it can be turned up loud, the inbuilt speakers (2) are very strong.</p>
<p><strong>Weakest links</strong></p>
<p>Some of the UI elements are strange to say the least, example: To play text-to-speech press <em>Shift</em> and <em>SYM</em>. There&#8217;s no &#8220;speech&#8221; button or menu item. huh? This goes for trying to find the Web Browser, and in all honesty the Kindle Store should be linked from the Home screen (not from a menu).</p>
<p>By far the weakest link with the Kindle in Australia is <em>gulp</em> the Kindle Store itself.</p>
<p>I was unable to find anything from these authors: Clive Cussler, Bryce Courtney, Dan Brown, Raymond E Fiest.</p>
<p>Furthering the damage, there&#8217;s limited selection of books (2) from Neal Stephenson (I wanted to get Cryptonomicon) and Faye Kellerman sees only 3 books. </p>
<p>There&#8217;s simply not enough books (though you&#8217;re fine if you want to read the Twilight series /sigh) and I feel that Amazon really needs to work hard on the publishers and get more books into the Amazon Kindle Store.</p>
<p>No backlight. Not a curse, but it would have taken it to 11.</p>
<p><strong>Summary</strong></p>
<p>Now I have one (only 48 hours old), would I recommend one? Easily yes, and after thinking heavily price would be the only deciding factor.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Mozketo?a=GoXsL_VJV0E:-K7mnDZldk4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Mozketo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Mozketo?a=GoXsL_VJV0E:-K7mnDZldk4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Mozketo?i=GoXsL_VJV0E:-K7mnDZldk4:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://mozketo.com/kindle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mozketo.com/kindle/</feedburner:origLink></item>
		<item>
		<title>Fixing Visual Studio’s error ‘The project location is not trusted’</title>
		<link>http://feedproxy.google.com/~r/Mozketo/~3/dFLPBX3GQLI/</link>
		<comments>http://mozketo.com/fixing-visual-studios-error-the-project-location-is-not-trusted/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 12:27:28 +0000</pubDate>
		<dc:creator>Mozketo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mozketo.com/?p=244</guid>
		<description><![CDATA[Scenario: My base machine (mac) hosts all my source code as I want a single code point to backup. My Windows development environment is in a Virtual Machine using VMWare Fusion. (I believe this issue will apply to VMWare Workstation, Player and Fusion). 
I am using the VMWare built in &#8220;Share Folder&#8221; option, and I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>Scenario: My base machine (mac) hosts all my source code as I want a single code point to backup. My Windows development environment is in a Virtual Machine using VMWare Fusion. (I believe this issue will apply to VMWare Workstation, Player and Fusion). </p>
<p>I am using the VMWare built in &#8220;Share Folder&#8221; option, and I&#8217;m sharing only the &#8220;win&#8221; folder in my ~\src\ folder.</p>
<p><a href="http://mozketo.com/wp-content/uploads/2009/09/Screen-shot-2009-09-29-at-10.19.55-PM.png"><img src="http://mozketo.com/wp-content/uploads/2009/09/Screen-shot-2009-09-29-at-10.19.55-PM.png" alt="Screen shot 2009-09-29 at 10.19.55 PM" title="Screen shot 2009-09-29 at 10.19.55 PM" width="496" height="92" class="alignnone size-full wp-image-246" /></a></p>
<p>Issue: When trying to open source using Visual Studio 2008 I&#8217;m presented with the dreaded &#8220;The project location is not trusted&#8221; error.</p>
<p>Solution: Open a Command-Line box (Start > Run > cmd > OK)</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p244code2'); return false;">View Code</a> DOS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2442"><td class="code" id="p244code2"><pre class="dos" style="font-family:monospace;"><a href="http://www.ss64.com/nt/cd.html"><span style="color: #b1b100; font-weight: bold;">cd</span></a> \Windows\Microsoft.NET\Framework\v2.0.50727
caspol -m -ag <span style="color: #cc66cc;">1.2</span> -url \\.host\* FullTrust</pre></td></tr></table></div>

<p>If you&#8217;re not using VMWare or have a share elsewhere substitute &#8220;\\.host\*&#8221; for your shared folder.</p>
<p>References: <a href="http://msdn.microsoft.com/en-us/library/bs2bkwxc.aspx">The project location is not trusted dialog box</a> and <a href="http://social.msdn.microsoft.com/Forums/en-US/vssetup/thread/5065fd7c-f2ed-4ddc-8242-19c0eda2a1a1">The project location is not trusted dialog box when trying to use a Network Location</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Mozketo?a=dFLPBX3GQLI:G7uyYlvD3co:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Mozketo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Mozketo?a=dFLPBX3GQLI:G7uyYlvD3co:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Mozketo?i=dFLPBX3GQLI:G7uyYlvD3co:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://mozketo.com/fixing-visual-studios-error-the-project-location-is-not-trusted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mozketo.com/fixing-visual-studios-error-the-project-location-is-not-trusted/</feedburner:origLink></item>
		<item>
		<title>Sql Compact and Fluent NHibernate</title>
		<link>http://feedproxy.google.com/~r/Mozketo/~3/GhYgSKGYj5U/</link>
		<comments>http://mozketo.com/sql-compact-and-fluent-nhibernate/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 12:16:06 +0000</pubDate>
		<dc:creator>Mozketo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Fluent-NHibernate]]></category>

		<guid isPermaLink="false">http://mozketo.com/?p=233</guid>
		<description><![CDATA[I wanted a drop dead simple Fluent NHibernate connection to a Sql Compact (.sdf) file and was able to use:

?View Code CSHARPprivate const string DbFile = &#34;firstProgram.db&#34;;
&#160;
return Fluently.Configure&#40;&#41;
    .Database&#40;MsSqlCeConfiguration.Standard.ShowSql&#40;&#41;.ConnectionString&#40;c =&#62;
        c.Is&#40;&#34;data source=&#34; + dbFile&#41;&#41;
        &#41;
    [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted a drop dead simple Fluent NHibernate connection to a Sql Compact (.sdf) file and was able to use:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p233code5'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2335"><td class="code" id="p233code5"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">private</span> <span style="color: #0600FF;">const</span> <span style="color: #FF0000;">string</span> DbFile <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;firstProgram.db&quot;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF;">return</span> Fluently.<span style="color: #0000FF;">Configure</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    .<span style="color: #0000FF;">Database</span><span style="color: #000000;">&#40;</span>MsSqlCeConfiguration.<span style="color: #0000FF;">Standard</span>.<span style="color: #0000FF;">ShowSql</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ConnectionString</span><span style="color: #000000;">&#40;</span>c <span style="color: #008000;">=&gt;</span>
        c.<a href="http://www.google.com/search?q=is+msdn.microsoft.com"><span style="color: #008000;">Is</span></a><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;data source=&quot;</span> <span style="color: #008000;">+</span> dbFile<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#41;</span>
    .<span style="color: #0000FF;">Mappings</span><span style="color: #000000;">&#40;</span>m <span style="color: #008000;">=&gt;</span>
        m.<span style="color: #0000FF;">FluentMappings</span>.<span style="color: #0000FF;">AddFromAssemblyOf</span><span style="color: #008000;">&lt;</span>Program<span style="color: #008000;">&gt;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#41;</span>
    .<span style="color: #0000FF;">ExposeConfiguration</span><span style="color: #000000;">&#40;</span>BuildSchema<span style="color: #000000;">&#41;</span>
    .<span style="color: #0000FF;">BuildSessionFactory</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></td></tr></table></div>

<p>Whereas the Sqlite connection was:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p233code6'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2336"><td class="code" id="p233code6"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">private</span> <span style="color: #0600FF;">const</span> <span style="color: #FF0000;">string</span> DbFile <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;firstProgram.db&quot;</span><span style="color: #008000;">;</span>
&nbsp;
 <span style="color: #0600FF;">return</span> Fluently.<span style="color: #0000FF;">Configure</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    .<span style="color: #0000FF;">Database</span><span style="color: #000000;">&#40;</span>SQLiteConfiguration.<span style="color: #0000FF;">Standard</span>
        .<span style="color: #0000FF;">UsingFile</span><span style="color: #000000;">&#40;</span>dbFile<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#41;</span>
    .<span style="color: #0000FF;">Mappings</span><span style="color: #000000;">&#40;</span>m <span style="color: #008000;">=&gt;</span>
        m.<span style="color: #0000FF;">FluentMappings</span>.<span style="color: #0000FF;">AddFromAssemblyOf</span><span style="color: #008000;">&lt;</span>Program<span style="color: #008000;">&gt;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#41;</span>
    .<span style="color: #0000FF;">ExposeConfiguration</span><span style="color: #000000;">&#40;</span>BuildSchema<span style="color: #000000;">&#41;</span>
    .<span style="color: #0000FF;">BuildSessionFactory</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></td></tr></table></div>

<p>When Googling I wasn&#8217;t able to find any samples so I hope to fill that void.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Mozketo?a=GhYgSKGYj5U:qpKoZ5XRoic:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Mozketo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Mozketo?a=GhYgSKGYj5U:qpKoZ5XRoic:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Mozketo?i=GhYgSKGYj5U:qpKoZ5XRoic:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://mozketo.com/sql-compact-and-fluent-nhibernate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mozketo.com/sql-compact-and-fluent-nhibernate/</feedburner:origLink></item>
		<item>
		<title>Mecurial .hgignore for C# and VB .net Projects</title>
		<link>http://feedproxy.google.com/~r/Mozketo/~3/wRmADnYTCVM/</link>
		<comments>http://mozketo.com/mercurial-hignore/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 11:26:59 +0000</pubDate>
		<dc:creator>Mozketo</dc:creator>
				<category><![CDATA[Source Control]]></category>
		<category><![CDATA[Mercurial]]></category>

		<guid isPermaLink="false">http://mozketo.com/?p=220</guid>
		<description><![CDATA[There&#8217;s certain files and folders that you don&#8217;t want to put into source control. With Mercurial all you need is a .hgignore file in the root path of your project. A simple windowsy way of doing this is (from a command line) is by typing
notepad c:\path_to_code\.hgignore
This will create the file so now simply add the [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s certain files and folders that you don&#8217;t want to put into source control. With <a href="http://mercurial.selenic.com/wiki/">Mercurial </a>all you need is a .hgignore file in the root path of your project. A simple windowsy way of doing this is (from a command line) is by typing</p>
<p><code>notepad c:\path_to_code\.hgignore</code></p>
<p>This will create the file so now simply add the following lines to the file:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p220code9'); return false;">View Code</a> DOS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2209"><td class="code" id="p220code9"><pre class="dos" style="font-family:monospace;"># use glob syntax.
syntax: glob
&nbsp;
# Misc Mac/Windows stuff
&nbsp;
.DS_Store
Thumbs.db
Desktop.ini
&nbsp;
# builds
&nbsp;
*.exe
*.ex_
&nbsp;
# vb6
&nbsp;
*.SCC
*.vbw
*.pdb
*.log
*.Log
&nbsp;
# c-sharp
#ProjectName/bin
#ProjectName/obj
*.user
*.suo
_ReSharper.*
*.sln.cache</pre></td></tr></table></div>

<p><strong>Note:</strong> You need to change #ProjectName to your project foldername.</p>
<p>Now feel free to init/add/commit:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p220code10'); return false;">View Code</a> DOS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p22010"><td class="code" id="p220code10"><pre class="dos" style="font-family:monospace;">hg init
hg add
hg commit -m &quot;Initial Commit with ignores&quot;</pre></td></tr></table></div>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Mozketo?a=wRmADnYTCVM:F-xrlDi3HLY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Mozketo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Mozketo?a=wRmADnYTCVM:F-xrlDi3HLY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Mozketo?i=wRmADnYTCVM:F-xrlDi3HLY:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://mozketo.com/mercurial-hignore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mozketo.com/mercurial-hignore/</feedburner:origLink></item>
		<item>
		<title>Resize UIView/UITableView when Keyboard displays</title>
		<link>http://feedproxy.google.com/~r/Mozketo/~3/8KCBxsgSZNw/</link>
		<comments>http://mozketo.com/resize-uiviewuitableview-when-keyboard-displays/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 00:33:43 +0000</pubDate>
		<dc:creator>Mozketo</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa]]></category>

		<guid isPermaLink="false">http://mozketo.com/?p=213</guid>
		<description><![CDATA[I was having a hell of a time trying to get my UITableView to resize itself after the iPhone keyboard displayed itself. After being just a little surprised that the iPhone doesn&#8217;t resize the underlying UIView for free I figured it was up to me to do resize.
Firstly add a few variables and method declares [...]]]></description>
			<content:encoded><![CDATA[<p>I was having a hell of a time trying to get my UITableView to resize itself after the iPhone keyboard displayed itself. After being just a little surprised that the iPhone doesn&#8217;t resize the underlying UIView for free I figured it was up to me to do resize.</p>
<p>Firstly add a few variables and method declares into your ViewController.h header file:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p213code16'); return false;">View Code</a> OBJC</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p21316"><td class="code" id="p213code16"><pre class="objc" style="font-family:monospace;">Boolean keyboardIsShowing;
CGRect keyboardBounds;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>resizeViewControllerToFitScreen;</pre></td></tr></table></div>

<p>Now we need to register for the UIKeyboardWillShowNotification and the UIKeyboardWillHideNotification:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p213code17'); return false;">View Code</a> OBJC</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p21317"><td class="code" id="p213code17"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/"><span style="color: #400080;">NSNotificationCenter</span></a> defaultCenter<span style="color: #002200;">&#93;</span> addObserver<span style="color: #002200;">:</span>self selector<span style="color: #002200;">:</span><span style="color: #a61390;">@selector</span><span style="color: #002200;">&#40;</span>keyboardWillShow<span style="color: #002200;">:</span><span style="color: #002200;">&#41;</span> name<span style="color: #002200;">:</span>UIKeyboardWillShowNotification object<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/"><span style="color: #400080;">NSNotificationCenter</span></a> defaultCenter<span style="color: #002200;">&#93;</span> addObserver<span style="color: #002200;">:</span>self selector<span style="color: #002200;">:</span><span style="color: #a61390;">@selector</span><span style="color: #002200;">&#40;</span>keyboardWillHide<span style="color: #002200;">:</span><span style="color: #002200;">&#41;</span> name<span style="color: #002200;">:</span>UIKeyboardWillHideNotification object<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;</pre></td></tr></table></div>

<p>And these notifications need somewhere to go:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p213code18'); return false;">View Code</a> OBJC</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p21318"><td class="code" id="p213code18"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#pragma mark -</span>
<span style="color: #6e371a;">#pragma mark Keyboard Handling</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>keyboardWillShow<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotification_Class/"><span style="color: #400080;">NSNotification</span></a> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>notification <span style="color: #002200;">&#123;</span>
	<a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/"><span style="color: #400080;">NSDictionary</span></a> <span style="color: #002200;">*</span>userInfo <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>notification userInfo<span style="color: #002200;">&#93;</span>;
	<a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSValue_Class/"><span style="color: #400080;">NSValue</span></a> <span style="color: #002200;">*</span>keyboardBoundsValue <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>userInfo objectForKey<span style="color: #002200;">:</span>UIKeyboardBoundsUserInfoKey<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>keyboardBoundsValue getValue<span style="color: #002200;">:&amp;</span>keyboardBounds<span style="color: #002200;">&#93;</span>;
	keyboardIsShowing <span style="color: #002200;">=</span> <span style="color: #a61390;">YES</span>;
	<span style="color: #002200;">&#91;</span>self resizeViewControllerToFitScreen<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>keyboardWillHide<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotification_Class/"><span style="color: #400080;">NSNotification</span></a> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>note <span style="color: #002200;">&#123;</span>
	keyboardIsShowing <span style="color: #002200;">=</span> <span style="color: #a61390;">NO</span>;
	keyboardBounds <span style="color: #002200;">=</span> CGRectMake<span style="color: #002200;">&#40;</span>0, 0, 0, 0<span style="color: #002200;">&#41;</span>;
	<span style="color: #002200;">&#91;</span>self resizeViewControllerToFitScreen<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>

<p>And now add the magic method to resize the view:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p213code19'); return false;">View Code</a> OBJC</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p21319"><td class="code" id="p213code19"><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>resizeViewControllerToFitScreen <span style="color: #002200;">&#123;</span>
	<span style="color: #11740a; font-style: italic;">// Needs adjustment for portrait orientation!</span>
	CGRect applicationFrame <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIScreen mainScreen<span style="color: #002200;">&#93;</span> applicationFrame<span style="color: #002200;">&#93;</span>;
	CGRect frame <span style="color: #002200;">=</span> self.view.frame;
	frame.size.height <span style="color: #002200;">=</span> applicationFrame.size.height;
&nbsp;
	<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>keyboardIsShowing<span style="color: #002200;">&#41;</span>
		frame.size.height <span style="color: #002200;">-=</span> keyboardBounds.size.height;
&nbsp;
	<span style="color: #002200;">&#91;</span>UIView beginAnimations<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span> context<span style="color: #002200;">:</span><span style="color: #a61390;">NULL</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>UIView setAnimationBeginsFromCurrentState<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>UIView setAnimationDuration<span style="color: #002200;">:</span>0.3f<span style="color: #002200;">&#93;</span>;
	self.view.frame <span style="color: #002200;">=</span> frame;
	<span style="color: #002200;">&#91;</span>UIView commitAnimations<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>

<p>And super importantly de-register the ViewController from those notifications.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p213code20'); return false;">View Code</a> OBJC</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p21320"><td class="code" id="p213code20"><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>viewWillDisappear<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">BOOL</span><span style="color: #002200;">&#41;</span>animated <span style="color: #002200;">&#123;</span>
	<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/"><span style="color: #400080;">NSNotificationCenter</span></a> defaultCenter<span style="color: #002200;">&#93;</span> removeObserver<span style="color: #002200;">:</span>self name<span style="color: #002200;">:</span>UIKeyboardWillShowNotification object<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/"><span style="color: #400080;">NSNotificationCenter</span></a> defaultCenter<span style="color: #002200;">&#93;</span> removeObserver<span style="color: #002200;">:</span>self name<span style="color: #002200;">:</span>UIKeyboardWillHideNotification object<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>

<p>See how this all comes together?</p>
<p>1. We register for Notifications when the Keyboard shows/hides,<br />
2. We react when the keyboard is shown/hidden,<br />
3. The resizeViewControllerToFitScreen method handles our resize, including animating the underlying view so it looks pretty.</p>
<p>There&#8217;s a few caveats:</p>
<p>1. I&#8217;ve not tested on Landscape mode, I&#8217;m pretty sure this will fail.<br />
2. UIKeyboardWillShowNotification can get fired every time you enter a textbox (as I&#8217;ve only one textbox it&#8217;s not a problem for me). So you might need to look at using &#8230;TextDidBeginEditing/&#8230;TextDidEndEditing or maintaining state differently so that the view isn&#8217;t jumping all over the place.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Mozketo?a=8KCBxsgSZNw:fPswQWXB7qE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Mozketo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Mozketo?a=8KCBxsgSZNw:fPswQWXB7qE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Mozketo?i=8KCBxsgSZNw:fPswQWXB7qE:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://mozketo.com/resize-uiviewuitableview-when-keyboard-displays/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://mozketo.com/resize-uiviewuitableview-when-keyboard-displays/</feedburner:origLink></item>
		<item>
		<title>Geektool: Use that wasted space beside the Dock</title>
		<link>http://feedproxy.google.com/~r/Mozketo/~3/PrLlNb19Amc/</link>
		<comments>http://mozketo.com/geektool-use-that-wasted-space-beside-the-dock/#comments</comments>
		<pubDate>Fri, 22 May 2009 06:01:32 +0000</pubDate>
		<dc:creator>Mozketo</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://mozketo.com/?p=164</guid>
		<description><![CDATA[One little gripe I&#8217;ve always had about in OS X is the apparent waste of space either side of the Dock (assuming you have it centred at the bottom of the screen).
Geektool to the rescue!

Here&#8217;s the little scripts that I use to get the weather (just change the region code ASXX0016 to your region from [...]]]></description>
			<content:encoded><![CDATA[<p>One little gripe I&#8217;ve always had about in OS X is the apparent waste of space either side of the Dock (assuming you have it centred at the bottom of the screen).</p>
<p><a href="http://projects.tynsoe.org/en/geektool/">Geektool</a> to the rescue!</p>
<p><a href='http://www.quicksnapper.com/Mozketo/image/-dock-w-weather-and-stats'><img src='http://www.quicksnapper.com/files/4932/14717678234A163D4C55EA8_m.png' alt='View the image at QuickSnapper.com' title='Hosted by QuickSnapper.com' width="505" /></a></p>
<p>Here&#8217;s the little scripts that I use to get the weather (just change the region code ASXX0016 to your region from <a href="http://weather.yahoo.com">weather.yahoo.com</a>. Your region code will be found in the yahoo URL):</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p164code24'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p16424"><td class="code" id="p164code24"><pre class="bash" style="font-family:monospace;">curl <span style="color: #660033;">--silent</span> <span style="color: #ff0000;">&quot;http://xml.weather.yahoo.com/forecastrss?p=ASXX0016&amp;u=c&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-E</span> <span style="color: #ff0000;">'(Current Conditions:|C&lt;BR)'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/Current Conditions://'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/&lt;br \/&gt;//'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/&lt;b&gt;//'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/&lt;\/b&gt;//'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/&lt;BR \/&gt;//'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/&lt;description&gt;//'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/&lt;\/description&gt;//'</span></pre></td></tr></table></div>


<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p164code25'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p16425"><td class="code" id="p164code25"><pre class="bash" style="font-family:monospace;">curl <span style="color: #660033;">--silent</span> <span style="color: #ff0000;">&quot;http://xml.weather.yahoo.com/forecastrss?p=ASXX0016&amp;u=c&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-E</span> <span style="color: #ff0000;">'(High:)'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/&lt;BR \/&gt;//'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/&lt;b&gt;//'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/&lt;\/b&gt;//'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/&lt;BR \/&gt;//'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/&lt;br \/&gt;//'</span></pre></td></tr></table></div>

<p>And the script for Memory usage, HDD space and Uptime:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p164code26'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p16426"><td class="code" id="p164code26"><pre class="bash" style="font-family:monospace;">top <span style="color: #660033;">-l</span> 1 <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'/PhysMem/ {print $10}'</span> 
<span style="color: #c20cb9; font-weight: bold;">df</span> <span style="color: #660033;">-hl</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'disk0s2'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $4}'</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Uptime: &quot;</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">uptime</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print &quot;&quot; $3 &quot; &quot; $4 &quot; &quot; $5 }'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/.$//g'</span>;<span style="color: #000000; font-weight: bold;">`</span></pre></td></tr></table></div>

<p>You might also be interested to check out other uses of Geektool on <a href="http://www.flickr.com/photos/tags/geektool/">Flickr</a></p>
<p>To Apple: Let us put Widgets on the Desktop too please (without having to use a hack).</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Mozketo?a=PrLlNb19Amc:1gVE0ok9Gg0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Mozketo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Mozketo?a=PrLlNb19Amc:1gVE0ok9Gg0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Mozketo?i=PrLlNb19Amc:1gVE0ok9Gg0:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://mozketo.com/geektool-use-that-wasted-space-beside-the-dock/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://mozketo.com/geektool-use-that-wasted-space-beside-the-dock/</feedburner:origLink></item>
		<item>
		<title>Super easy UIViewControllers and their nib/xib</title>
		<link>http://feedproxy.google.com/~r/Mozketo/~3/r9r4LrLm970/</link>
		<comments>http://mozketo.com/super-easy-uiviewcontrollers-and-their-nibxib/#comments</comments>
		<pubDate>Thu, 21 May 2009 11:27:50 +0000</pubDate>
		<dc:creator>Mozketo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mozketo.com/?p=159</guid>
		<description><![CDATA[I don&#8217;t like initialising my UIViewControllers and their associated nib explicitly using a string

?View Code OBJCFlipsideViewController *viewController = &#91;&#91;FlipsideViewController alloc&#93;
 initWithNibName:@&#34;FlipsideView&#34; bundle:nil&#93;;

But would rather my UIViewControllers know how to load themselves. This reduces the possibilities of typos, allows for only 1 place in code where your nib is referenced by name, and just looks better.
For [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t like initialising my UIViewControllers and their associated nib explicitly using a string</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p159code30'); return false;">View Code</a> OBJC</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p15930"><td class="code" id="p159code30"><pre class="objc" style="font-family:monospace;">FlipsideViewController <span style="color: #002200;">*</span>viewController <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>FlipsideViewController alloc<span style="color: #002200;">&#93;</span>
 initWithNibName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;FlipsideView&quot;</span> bundle<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;</pre></td></tr></table></div>

<p>But would rather my UIViewControllers know how to load themselves. This reduces the possibilities of typos, allows for only 1 place in code where your nib is referenced by name, and just looks better.</p>
<p>For example in <em>FlipsideViewController.m</em> I would add:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p159code31'); return false;">View Code</a> OBJC</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p15931"><td class="code" id="p159code31"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span>initWithNibName<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span style="color: #400080;">NSString</span></a> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>nibNameOrNil 
bundle<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSBundle_Class/"><span style="color: #400080;">NSBundle</span></a> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>nibBundleOrNil <span style="color: #002200;">&#123;</span>
  <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#40;</span>self <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>super initWithNibName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;FlipsideView&quot;</span> bundle<span style="color: #002200;">:</span>nibBundleOrNil<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>  <span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">// Initialization code		</span>
  <span style="color: #002200;">&#125;</span>
  <span style="color: #a61390;">return</span> self;
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>

<p>Now you can simply initialise the ViewController using</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p159code32'); return false;">View Code</a> OBJC</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p15932"><td class="code" id="p159code32"><pre class="objc" style="font-family:monospace;">FlipsideViewController <span style="color: #002200;">*</span>viewController <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>FlipsideViewController alloc<span style="color: #002200;">&#93;</span> 
init<span style="color: #002200;">&#93;</span>;</pre></td></tr></table></div>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Mozketo?a=r9r4LrLm970:Gwq3RW0BsxU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Mozketo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Mozketo?a=r9r4LrLm970:Gwq3RW0BsxU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Mozketo?i=r9r4LrLm970:Gwq3RW0BsxU:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://mozketo.com/super-easy-uiviewcontrollers-and-their-nibxib/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mozketo.com/super-easy-uiviewcontrollers-and-their-nibxib/</feedburner:origLink></item>
		<item>
		<title>Who’s Ben Clark-Robinson?</title>
		<link>http://feedproxy.google.com/~r/Mozketo/~3/mz8dOcULhZI/</link>
		<comments>http://mozketo.com/whos-ben-clark-robinson/#comments</comments>
		<pubDate>Wed, 20 May 2009 05:42:32 +0000</pubDate>
		<dc:creator>Mozketo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mozketo.com/?p=179</guid>
		<description><![CDATA[Mozketo blog is written by Ben Clark-Robinson about Cocoa development, Apple and my adventures in .net. (A strange mix, yes).

I am a c# .net software engineer by day, though once the sun sets low below the horizon and the Apple startup sequence chimes I am transformed into a Cocoa &#38; Cocoa Touch engineer.
I have a [...]]]></description>
			<content:encoded><![CDATA[<p>Mozketo blog is written by Ben Clark-Robinson about Cocoa development, Apple and my adventures in .net. (A strange mix, yes).</p>
<p><img src="http://mozketo.com/wp-content/themes/mozketo/images/me_bw_240px.jpg" alt="Ben Clark-Robinson" title="Self portrait" /></p>
<p>I am a c# .net software engineer by day, though once the sun sets low below the horizon and the Apple startup sequence chimes I am transformed into a Cocoa &amp; Cocoa Touch engineer.</p>
<p>I have a diploma in IT and a degree in IT major Software Engineering.</p>
<h2>Bits and pieces i&#8217;ve worked on</h2>
<p>Websites: <a href="http://mozketo.com">Mozketo</a> (this site) or <a href="http://www.wgarchitects.com.au/">WGA</a>.</p>
<p>Web applications: Servizio (Windows Mobile)</p>
<p>Desktop application: Membership</p>
<p><a href="http://mozketo.com/wp-content/uploads/2009/05/mrp01_l.png"><img src="http://mozketo.com/wp-content/uploads/2009/05/mrp01_s.png" alt="mrp01_s" title="mrp01_s" width="344" height="64" class="alignnone size-full wp-image-205" /></a></p>
<h2>Home computer setup</h2>
<p>Macbook Pro with external <a href="http://mozketo.com/benq-2200hd-review/">22&#8243; Benq LCD</a>, bluetooth wireless Apple keyboard, <a href="http://mozketo.com/bluetooth-mouse-for-mac-os-x/">MS Notebook Mouse 5000</a>, and my well loved iPhone 3G.</p>
<h2>Favoured Apple Software</h2>
<p><a href="http://macrabbit.com/cssedit/">CSSEdit</a><br />
<a href="http://macromates.com/">TextMate</a><br />
<a href="http://www.panic.com/transmit/">Transmit</a><br />
<a href="http://www.apple.com/aperture/">Aperture</a><br />
<a href="http://flyingmeat.com/voodoopad/">Voodoo Pad</a><br />
<a href="http://www.realmacsoftware.com/littlesnapper/">Littlesnapper</a> &#8211; <a href="http://www.quicksnapper.com/Mozketo/">Quicksnapper profile</a></p>
<h2>Server related</h2>
<p>Using a Joyent shared hosting server and Wordpress with a custom Mozketo template.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Mozketo?a=mz8dOcULhZI:U7zyPFa-rFM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Mozketo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Mozketo?a=mz8dOcULhZI:U7zyPFa-rFM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Mozketo?i=mz8dOcULhZI:U7zyPFa-rFM:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://mozketo.com/whos-ben-clark-robinson/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mozketo.com/whos-ben-clark-robinson/</feedburner:origLink></item>
		<item>
		<title>Bluetooth Mouse for Mac OS X</title>
		<link>http://feedproxy.google.com/~r/Mozketo/~3/hpiGq3lAw2Y/</link>
		<comments>http://mozketo.com/bluetooth-mouse-for-mac-os-x/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 23:07:42 +0000</pubDate>
		<dc:creator>Mozketo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mozketo.com/?p=145</guid>
		<description><![CDATA[I&#8217;m trying to find the best Bluetooth Mouse for Apple Mac OS X. I really like being able to just turn on a mouse and boom it works without having to plug in a dongle. So I&#8217;ve compiled a mini-review of the Bluetooth mice I&#8217;ve tried to date and hoping you could help me expand [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m trying to find the best Bluetooth Mouse for Apple Mac OS X. I really like being able to just turn on a mouse and <em>boom</em> it works without having to plug in a dongle. So I&#8217;ve compiled a mini-review of the Bluetooth mice I&#8217;ve tried to date and hoping you could help me expand the list.<span id="more-145"></span></p>
<h2>Bluetooth Mighty Mouse</h2>
<p><a href="http://www.apple.com/au/mightymouse/">Link</a>. While I want to love the Mighty Mouse I constantly find myself fighting with it.</p>
<h3>Pros</h3>
<p>Works well with OS X as it connects fast and gives a battery level in System Preferences or a pop-up Bezel when the battery runs low. AA batteries.</p>
<h3>Cons</h3>
<p>A little heavy for my liking. Sometimes misreads right-clicks for normal clicks (makes World of Warcraft an exercise in frustration). That scroll nipple is impossible to keep working after 3-6 months, it simply gunks up and stops working reliably.</p>
<p><strong>Rating: 4/10</strong></p>
<h2>Microsoft Bluetooth Notebook Mouse 5000</h2>
<p><a href="http://www.microsoft.com/hardware/mouseandkeyboard/ProductDetails.aspx?pid=099"></a><a href="http://mozketo.com/wp-content/uploads/2009/03/microsoftbluetooth5000.png"><img class="alignnone size-full wp-image-151" title="microsoftbluetooth5000" src="http://mozketo.com/wp-content/uploads/2009/03/microsoftbluetooth5000.png" alt="microsoftbluetooth5000" width="242" height="175" /></a></p>
<p><a href="http://www.microsoft.com/hardware/mouseandkeyboard/ProductDetails.aspx?pid=099">Link</a>. I&#8217;m quite a fan of this little mouse.</p>
<h3>Pros</h3>
<p>Light, fast, easy to pair between OS X and Bootcamp (just remember to turn off/on while the &#8216;puter reboots. Tactile scroll-wheel is still working 12 months later. AAA batteries that last ages.</p>
<h3>Cons</h3>
<p>The movement (perhaps the resolution) of the mouse appears jerky sometimes and any fine moments (eg when using <a href="http://flyingmeat.com/acorn/">Acorn</a>) renders the mouse impossble. No battery indication in OS X.</p>
<p><strong>Rating: 7/10</strong></p>
<h2>Logitech V470 Cordless Laser Mouse for Notebooks</h2>
<p><a href="http://www.logitech.com/index.cfm/mice_pointers/mice/devices/3287&amp;cl=au,en#"></a><a href="http://mozketo.com/wp-content/uploads/2009/03/logitechv470.png"><img class="alignnone size-full wp-image-152" title="logitechv470" src="http://mozketo.com/wp-content/uploads/2009/03/logitechv470.png" alt="logitechv470" width="479" height="398" /></a></p>
<p><a href="http://www.logitech.com/index.cfm/home/&#038;cl=au,en">Link</a>. Untried.</p>
<p>Perhaps you have recommendation?</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Mozketo?a=hpiGq3lAw2Y:IUnEiazo-uA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Mozketo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Mozketo?a=hpiGq3lAw2Y:IUnEiazo-uA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Mozketo?i=hpiGq3lAw2Y:IUnEiazo-uA:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://mozketo.com/bluetooth-mouse-for-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://mozketo.com/bluetooth-mouse-for-mac-os-x/</feedburner:origLink></item>
		<item>
		<title>Core Animation CAConstraint Grid-Cell Layout</title>
		<link>http://feedproxy.google.com/~r/Mozketo/~3/1y6Mq8BDf6A/</link>
		<comments>http://mozketo.com/core-animation-caconstraint-grid-cell-layout/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 02:40:53 +0000</pubDate>
		<dc:creator>Mozketo</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[CAConstraint]]></category>
		<category><![CDATA[Core Animation]]></category>

		<guid isPermaLink="false">http://mozketo.com/?p=127</guid>
		<description><![CDATA[I really wanted to get a nice Grid Layout using CAConstraint, but I found the situation getting very complex very fast as each Cell needed to be able to reference the location of the last Cell and whether or not the Cell needed to drop down to a new Row, and at times needed to [...]]]></description>
			<content:encoded><![CDATA[<p>I really wanted to get a nice Grid Layout using CAConstraint, but I found the situation getting very complex very fast as each Cell needed to be able to reference the location of the last Cell and whether or not the Cell needed to drop down to a new Row, and at times needed to also reference the @&#8221;superlayer&#8221;. There has to be a better way, right?</p>
<p><a href="http://mozketo.com/wp-content/uploads/2009/02/caconstraint-gridlayout-sample.png"><img class="alignnone size-full wp-image-131" title="caconstraint-gridlayout-sample" src="http://mozketo.com/wp-content/uploads/2009/02/caconstraint-gridlayout-sample.png" alt="CAConstraint Grid-Cell Layout with Animations" width="351" height="172" /></a></p>
<p>After a little digging around I was able to find an amazing Hot Chocolate <a href="http://devblog.brautaset.org/2008/10/01/calayer-grid-with-caconstraintlayoutmanager/">blog post</a> which showed a fantastic trick when laying out the Cells without having to reference the prior Cell. This approach takes advantage of knowing the Cell Row/Column position plus using the Scale: attribute of the CAConstraint on the @&#8221;superlayer&#8221; and it works like a charm.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p127code37'); return false;">View Code</a> OBJC</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p12737"><td class="code" id="p127code37"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span>CAConstraint constraintWithAttribute<span style="color: #002200;">:</span> kCAConstraintWidth
relativeTo<span style="color: #002200;">:</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;superlayer&quot;</span>
attribute<span style="color: #002200;">:</span> kCAConstraintWidth
scale<span style="color: #002200;">:</span> 1.0 <span style="color: #002200;">/</span> columns
offset<span style="color: #002200;">:</span> 0<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;</pre></td></tr></table></div>

<p>Want to change the number of Cells in the Grid? Modify these variables in this method:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p127code38'); return false;">View Code</a> OBJC</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p12738"><td class="code" id="p127code38"><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>layoutCellsInGridLayer<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CALayer <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>layer <span style="color: #002200;">&#123;</span>
	<span style="color: #a61390;">int</span> columns <span style="color: #002200;">=</span> <span style="color: #2400d9;">6</span>;
	<span style="color: #a61390;">int</span> rows <span style="color: #002200;">=</span> <span style="color: #2400d9;">6</span>;...</pre></td></tr></table></div>

<p>Also to give the project a little bit of &#8220;wow&#8221; here&#8217;s some random Y rotation on a Cell Layer:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p127code39'); return false;">View Code</a> OBJC</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p12739"><td class="code" id="p127code39"><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>setupFlipAnimationOnLayer<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CALayer <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>layer <span style="color: #002200;">&#123;</span>
	<span style="color: #a61390;">float</span> duration <span style="color: #002200;">=</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">float</span><span style="color: #002200;">&#41;</span>frandom<span style="color: #002200;">&#40;</span>0.5, 5.0<span style="color: #002200;">&#41;</span>;
&nbsp;
	CABasicAnimation<span style="color: #002200;">*</span> animation <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CABasicAnimation animationWithKeyPath<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;transform.rotation.y&quot;</span><span style="color: #002200;">&#93;</span>;
	animation.fromValue <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNumber_Class/"><span style="color: #400080;">NSNumber</span></a> numberWithDouble<span style="color: #002200;">:-</span>1.0f <span style="color: #002200;">*</span> M_PI<span style="color: #002200;">&#93;</span>;
	animation.toValue <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNumber_Class/"><span style="color: #400080;">NSNumber</span></a> numberWithDouble<span style="color: #002200;">:</span>1.0f <span style="color: #002200;">*</span> M_PI<span style="color: #002200;">&#93;</span>;
	animation.duration <span style="color: #002200;">=</span> duration;
	animation.repeatCount <span style="color: #002200;">=</span> 1e100f;
	animation.beginTime <span style="color: #002200;">=</span> CACurrentMediaTime<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">+</span> frandom<span style="color: #002200;">&#40;</span>0.1, 30<span style="color: #002200;">&#41;</span>;
	animation.timingFunction <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CAMediaTimingFunction functionWithName<span style="color: #002200;">:</span>kCAMediaTimingFunctionEaseInEaseOut<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #002200;">&#91;</span>layer addAnimation<span style="color: #002200;">:</span>animation forKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;rotationY&quot;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>

<p>To get the nice 3D perspective look the project needs the following code:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p127code40'); return false;">View Code</a> OBJC</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p12740"><td class="code" id="p127code40"><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>setupPerspectiveWithX<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">float</span><span style="color: #002200;">&#41;</span>x andY<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">float</span><span style="color: #002200;">&#41;</span>y <span style="color: #002200;">&#123;</span>
	CATransform3D transform <span style="color: #002200;">=</span> CATransform3DMakeRotation<span style="color: #002200;">&#40;</span>x, 0, 1, 0<span style="color: #002200;">&#41;</span>;
	transform <span style="color: #002200;">=</span> CATransform3DRotate<span style="color: #002200;">&#40;</span>transform, y, 1, 0, 0<span style="color: #002200;">&#41;</span>;
	<span style="color: #a61390;">float</span> zDistance <span style="color: #002200;">=</span> <span style="color: #002200;">-</span><span style="color: #2400d9;">450</span>;
	transform.m34 <span style="color: #002200;">=</span> 1.0 <span style="color: #002200;">/</span> <span style="color: #002200;">-</span>zDistance;
	gridLayer.sublayerTransform <span style="color: #002200;">=</span> transform;
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>

<p>And one last final note: take a look in <code>createCellInParentLayer:</code> and you will see <code>layer.contents</code>. If you can provide your own image the layer will automatically Fill (<code>layer.contentsGravity = kCAGravityResizeAspectFill;</code>) and Mask (<code>layer.masksToBounds = YES;</code>)  to make it fit.</p>
<p>You can grab the <a href='http://mozketo.com/wp-content/uploads/2009/02/caconstraint-grid-layout.zip'>code here</a> or download the <a href='http://mozketo.com/wp-content/uploads/2009/02/caconstraintgridlayoutapp.zip'>binary here</a> (requires Leopard).</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/Mozketo?a=WMykDBr4"><img src="http://feeds.feedburner.com/~f/Mozketo?d=41" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/Mozketo?a=0OfCkxr6"><img src="http://feeds.feedburner.com/~f/Mozketo?i=0OfCkxr6" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://mozketo.com/core-animation-caconstraint-grid-cell-layout/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://mozketo.com/core-animation-caconstraint-grid-cell-layout/</feedburner:origLink></item>
	</channel>
</rss>
