<?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>King Software Designs</title>
	<atom:link href="http://kingsoftwaredesigns.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://kingsoftwaredesigns.com</link>
	<description>From Concept to Maintenance</description>
	<lastBuildDate>Mon, 24 Jan 2011 23:38:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Managing Camera Data</title>
		<link>http://kingsoftwaredesigns.com/2011/01/managing-camera-data/</link>
		<comments>http://kingsoftwaredesigns.com/2011/01/managing-camera-data/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 18:08:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kingsoftwaredesigns.com/?p=124</guid>
		<description><![CDATA[An app I&#8217;m working on uses the AVFoundation API&#8217;s for direct access to the camera.   Soon after opening the camera it&#8217;s clear how easy it is to shoot yourself in the foot juggling 5mp images around.   My first approach used a Core Data &#8220;cache&#8221; that I could use to get images at specific [...]]]></description>
			<content:encoded><![CDATA[<p>An app I&#8217;m working on uses the AVFoundation API&#8217;s for direct access to the camera.   Soon after opening the camera it&#8217;s clear how easy it is to shoot yourself in the foot juggling 5mp images around.   My first approach used a Core Data &#8220;cache&#8221; that I could use to get images at specific sizes, and resize them and store them in the cache if required.   It worked, was quick to develop, but slow as a dog!   Startup and runtime performance was pretty good, but writing new images from the Camera were in the 5-6 second range.  Obviously not acceptable!</p>
<h3>Core Data should not be used to store large blobs.</h3>
<p>I knew it when I wrote the code, so this wasn&#8217;t a shock, but boy does this cause a lot of thrashing.   I learned a lot from the WWDC10 Advanced Performance Optimization on iPhone part 2 &#8211; A very good presentation, one I wish I revisited sooner.  Apparently, blob&#8217;s under 2k are fine, but blobs over that interefere with SQLite&#8217;s page caching.   Marcus Zarra advises keeping Blob&#8217;s under 100k.    Regardless who&#8217;s advice you take, do not store 5mp images in Core Data.</p>
<h3>Timestamping Image Operations can be deceiving</h3>
<p>In the sake of efficiency, where the image is decompressed varies, and printing out timstamps is not accurate for all actions.   For example, I can setup a CGImageRef to my 5mp image in .02 seconds on an iPhone4!   However, when Quartz goes to render the image, CAPrepareTransaction balloons up decompressing the image on the fly.   This is a great feature, but it will force your technique for profiling data.   This is a general issue for profiling.   What occurs under the hood on most of the functions I&#8217;m investigating is completely context dependent.   All the times in this article I attempt to isolate the work being done over a chunk of time.   I did some investigation with Instruments, but all the times were taken with timestamps.</p>
<h3>Getting Data from the Camera</h3>
<p>When you setting up a AVCaptureStillImageOutput, make sure the AVVideoCodecKey is &#8216;jpeg&#8217;.    BGRA will give you faster access to the bytes if you need to do on the fly processing of the bits, but that is only a concern if you&#8217;re doing image processing.   Getting the jpeg bytes to disk took around .7 seconds, as opposed to *6* seconds for BGRA.    The average time to get access to the CMSampleBufferRef was .5 for jpeg and 2.0 for BGRA.  I&#8217;m guessing the increased access time is due to the increased memory bandwidth and the increased write time due to compressing the software on the CPU instead of dedicated hardware.   I was always using jpeg output, but did some tests with BGRA to see if they would resize faster.   They didn&#8217;t.</p>
<h3>Do not fight the Compression</h3>
<p>Using JPEG  is great for getting the data to disk, but getting a UIImage I can use in my app was still slow.   To resize using Core Graphics, you still need a CGImageRef of the 5mp image to downsample, meaning the image needed to be decompressed.   Resizing to 1024 was taking 1.4-1.8 seconds.   What this was doing was probably a combination of resizing, memory IO and jpeg compression.   I tried a few different methods of resizing but nothing dented the times.   This approach gave me a 2 second delay before I could show an image to the user.</p>
<h3>ImageIO</h3>
<p>New in iOS4 is CGImageSource, which can efficiently create thumbnails with CGImageSourceCreateThumbnailAtIndex.    It appears to be smart with resizing jpegs, using the format to it&#8217;s advantage and creating jpegs without de-compressing the whole image.   It also claims to store the thumbnail inside the image for faster loading in the future.   This is something I&#8217;m still tinkering with, but just changing to this access method cut my resize time down from 1.4-1.8 seconds to 0.7-0.9 seconds.   A nice speed up!</p>
<h3 style="font-size: 1.17em;">Writing to disk</h3>
<p>Finally to get that image to disk, write the original NSData blob to disk atomically.   When I wrote the image with CGImageDestination and copied over the image source, it was in the 2-3 seconds vs 0.1 seconds for NSData&#8217;s writeToFile:atomically:.   Again, do not fight your compression!    I was hoping that CGImageDestination would write out the thumbnail I created, but it didn&#8217;t.   I&#8217;ll have to look at that again, my hunch is that the format of the image is not jpeg2000 and that regular jpeg can&#8217;t store thumbnails.   Oh well, I can cache in a separate file!</p>
<h3 style="font-size: 1.17em;">Grand Central Dispatch</h3>
<p>Once the timing is tuned, and the memory usage is efficient as it gets, take everything that takes time off of the main thread.    I originally put a spinner on the camera button because I had would get an OOM crash if a few snaps backed up onto eachother.   Now I can take about 30 images before the low memory killer strikes &#8211; I&#8217;m guessing a backup of 10-15 images.</p>
<p>Hope this was informative, and if you are doing anything with the camera, I urge you to review the WWDC Performance Optimization presentations.   They are great!</p>
]]></content:encoded>
			<wfw:commentRss>http://kingsoftwaredesigns.com/2011/01/managing-camera-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VocalKit: Objective-C Wrapper for Speech Recognition</title>
		<link>http://kingsoftwaredesigns.com/2010/05/vocalkit-objective-c-wrapper-for-speech-recognition/</link>
		<comments>http://kingsoftwaredesigns.com/2010/05/vocalkit-objective-c-wrapper-for-speech-recognition/#comments</comments>
		<pubDate>Wed, 12 May 2010 02:59:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kingsoftwaredesigns.com/?p=121</guid>
		<description><![CDATA[I finally wrapped up some of my efforts with Pocket Sphinx into a library, VocalKit.   My main goal is to make it easy for developers to over come the setup and learning curve with Pocket Sphinx in their iPhone / iPad apps.   VocalKit is a set of Dual-Architecture static libraries for PoketSphinx and [...]]]></description>
			<content:encoded><![CDATA[<p>I finally wrapped up some of my efforts with Pocket Sphinx into a library, <a href="http://github.com/KingOfBrian/VocalKit/">VocalKit</a>.   My main goal is to make it easy for developers to over come the setup and learning curve with <a href="http://cmusphinx.sourceforge.net/">Pocket Sphinx</a> in their iPhone / iPad apps.   VocalKit is a set of Dual-Architecture static libraries for PoketSphinx and Flite, and an Objective-C Wrapper that integrates with AudioQueue.   Also there is a Test Project you can build and run on your iPhone with out any code modification.   I hope to add <a href="http://julius.sourceforge.jp/en_index.php">Julius</a> support in the future.</p>
<p>Still plenty of work to do, but it&#8217;s a good start!</p>
]]></content:encoded>
			<wfw:commentRss>http://kingsoftwaredesigns.com/2010/05/vocalkit-objective-c-wrapper-for-speech-recognition/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>XCode Tricks for Tuning Core Animations</title>
		<link>http://kingsoftwaredesigns.com/2010/03/xcode-tricks-for-tuning-core-animations/</link>
		<comments>http://kingsoftwaredesigns.com/2010/03/xcode-tricks-for-tuning-core-animations/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 04:54:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kingsoftwaredesigns.com/?p=108</guid>
		<description><![CDATA[I was looking for a way to tune an animation to get the right feel.  It was getting frustrating to modify, rebuild, recompile and retest for every little change.    When the tuning is more of a feel than a right / wrong check, this was driving me mad.   By the time you changed the code, [...]]]></description>
			<content:encoded><![CDATA[<p>I was looking for a way to tune an animation to get the right feel.  It was getting frustrating to modify, rebuild, recompile and retest for every little change.    When the tuning is more of a feel than a right / wrong check, this was driving me mad.   By the time you changed the code, the feel was gone!</p>
<p>I remembered two XCode features that I thought might help, <strong>R<em>untime variable modification</em></strong> and  <strong><em>Breakpoint Actions</em></strong>.</p>
<ul>
<li><strong>Variable Modification</strong></li>
</ul>
<p>If  constants are moved into the function that starts the animation and they are static, they show up in the debug window.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-109" title="xcode-variable-modification" src="http://kingsoftwaredesigns.com/wp-content/uploads/2010/03/xcode-variable-modification.png" alt="xcode-variable-modification" width="721" height="133" /></p>
<p>If variables are static, the state sticks around to subsequent invocations.  This allows you to tune the constants, get a feel for it, and tune it again.</p>
<ul>
<li><strong>Breakpoint Actions</strong></li>
</ul>
<p>Another thing that helps when getting a feel for how your code is interacting with the phone is to add breakpoint sounds.   This will can cause XCode to play a sound or print a variable.   Select the breakpoint in the breakpoint group in the main tree, expand and press the + button.</p>
<p><img class="aligncenter size-full wp-image-112" title="xcode-breakpoint-actions" src="http://kingsoftwaredesigns.com/wp-content/uploads/2010/03/xcode-breakpoint-actions2.png" alt="xcode-breakpoint-actions" width="847" height="203" /></p>
<p>This wasn&#8217;t as helpful as I thought as the sound plays inline and causes a UI hickup.   Still an interesting trick so I thought I&#8217;d throw it out there.  Also while I was mucking around I found that you could print out variables right in GDB, which could be nice if you want to log something but not rebuild.</p>
<p>Anyone have any other good XCode tricks?</p>
]]></content:encoded>
			<wfw:commentRss>http://kingsoftwaredesigns.com/2010/03/xcode-tricks-for-tuning-core-animations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ramping up Rails with MOGenerator</title>
		<link>http://kingsoftwaredesigns.com/2010/03/ramping-up-rails-with-mogenerator/</link>
		<comments>http://kingsoftwaredesigns.com/2010/03/ramping-up-rails-with-mogenerator/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 18:46:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kingsoftwaredesigns.com/?p=103</guid>
		<description><![CDATA[I often find the need for a rails backed iPhone app.   I do some modeling of my domain objects in the iPhone and get the basic lay of the land.  Then I go off and create the rails world, determine the resource structure and add a JSON interface to the rails app.  Then [...]]]></description>
			<content:encoded><![CDATA[<p>I often find the need for a rails backed iPhone app.   I do some modeling of my domain objects in the iPhone and get the basic lay of the land.  Then I go off and create the rails world, determine the resource structure and add a JSON interface to the rails app.  Then I go back to the iPhone and add the <a href="http://allseeing-i.com/ASIHTTPRequest/">HTTP Requests</a> and JSON loading.   As the app develops, this definitely diverges, but for the initial spike, I keep thinking &#8220;Can&#8217;t I just generate my rails model off Core Data?&#8221;.</p>
<p>Enter <a href="http://rentzsch.com/code/mogenerator">MOGenerator</a>, which I think everyone should be using on their CoreData models.   It is a project that links a template language (<a href="http://github.com/rentzsch/mogenerator/tree/master/MiscMerge/">MiscMerge</a>, an apparently abandoned package) with the NSEntityDescription objects to build great wrappers for CoreData.  This separates your code from the machine generated code and keeps you from dreading changes to your data model.   Turns out this template language can generate any text.  My first thought was to use this to generate rails code, and soon there after I realized <a href="http://github.com/stuffmc/mogenerator/tree/">how much work that would be</a>.   I don&#8217;t want Core Data to be the authority of my rails data model though, I just want to cut out some tedious work in bootstrapping the rails app.</p>
<p>So I modified MOGenerator to&#8230; generate ./script/generate commands.  So yes, generating a shell command to generate rails code.   It doesn&#8217;t attempt to be a perfect (or complete) mapping of CoreData to Rails, just to save some time.</p>
<p>The modifications to MOGenerator are very simple.   MOGenerator is dynamic in what it can generate in it&#8217;s template files, BUT it hardcodes filenames in the program.  <a href="http://github.com/KingOfBrian/mogenerator">My fork</a> pushes the filename selection out into the template.   I found another <a href="http://github.com/rbartolome/mogenerator/commit/681cabf68db24b5063ccfa522dd9af1afd771f4a">github project</a> that forked just to change the hardcoding, so I&#8217;m hoping that <a href="http://github.com/rentzsch/mogenerator">rentzsch</a> incorporates the patch.</p>
<p>Moving forward I see two main things</p>
<ul>
<li>Modifying templates to use [EntityName].[hm] and [EntityName]+custom.[hm] rather than inheritance.  It&#8217;s just cleaner in my book to seperate with Categories rather than inheritance.</li>
<li>Pushing some busy-work JSON loading into [EntityName]+loadJSON.[hm].   This would define the JSON keys for each attribute into userInfo if it&#8217;s source was JSON.</li>
</ul>
<p>And if I were to dream, I see pushing the authority for my CoreData model into rails and auto-generating that from my rails model.  That way if I wanted an object or attribute to show up in my app, I could add a key and it would get added to the whole stack, and add versioning support&#8230;..   But reality quickly squashes that dream !</p>
]]></content:encoded>
			<wfw:commentRss>http://kingsoftwaredesigns.com/2010/03/ramping-up-rails-with-mogenerator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Voice Recognition on the iPhone</title>
		<link>http://kingsoftwaredesigns.com/2010/02/voice-recognition-on-the-iphone/</link>
		<comments>http://kingsoftwaredesigns.com/2010/02/voice-recognition-on-the-iphone/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 15:46:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Voice]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://kingsoftwaredesigns.com/?p=94</guid>
		<description><![CDATA[One of my projects has the potential to get a real usability boost through voice recognition.   Voice recognition is a utopia of mobile user interface, and like every utopia, it turns out to not work as well as you&#8217;d like in real life.   I spent some time looking into Open Source [...]]]></description>
			<content:encoded><![CDATA[<p>One of my projects has the potential to get a real usability boost through voice recognition.   Voice recognition is a utopia of mobile user interface, and like every utopia, it turns out to not work as well as you&#8217;d like in real life.   I spent some time looking into Open Source Voice Recognition packages and if you&#8217;re looking to use Voice Recognition for what is called &#8220;Very Large Vocabularies&#8221;, you are almost guaranteed to be disappointed.   If you are looking for Voice Commands, the default performance may be acceptable for what you are looking for.</p>
<p>Voice Recognition works by transforming each sample in an audio stream, guessing what pronunciation that sample might represent, and in turn, what word it might represent.   This involves both an Acoustic Model, and a Language Model to guide probabilities, and a number of algorithms to determine the result based off of those probabilities.   One key thing here is that bad results are usually not code bugs, but training deficiencies.   The Acoustic Models are trained by hundreds of hours of voice, but the free models are not as robust as comercial offerings.   If you want to do something about it, go to <a href="http://voxforge.org/">Vox Forge</a> and contribute some audio.   Restricting the language model goes a long way towards improving the results, as does training the Acoustic Model to your voice.   For my project, restricting the language model was the only option since my Acoustic Models need to be speaker independent.</p>
<p>I investigated 2 packages, <a href="http://cmusphinx.sourceforge.net/">Pocket Sphinx</a> and <a href="http://julius.sourceforge.jp/en_index.php"> Julius</a>.   Pocket Sphinx is the evolution of a long line of Voice Recognition packages based in C and developed by people in CMU.   Julius is a package developed most actively for the Japanese Language, but is still language agnostic.  </p>
<p>I had fun cleaning up the Mac experience for both of these projects.   Julius built fine but the CoreAudio driver was broken.  Pocket Sphinx had a few compile errors under XCode and no clear way to build iPhone friendly libraries.   So I submitted a new driver based off of the Audio Queue technology and submitted a patch that lets Pocket Sphinx build Mac and iPhone friendly binaries.  It was great to submit patches to both of these projects.      I still have an Audio Queue driver to write for Pocket Sphinx though!</p>
<p>So more on my project soon, but Pocket Sphinx is the package that I&#8217;m going to push forward with.   This is largely due to the fact that the default Acoustic Models appeared to perform better than Julius.   I&#8217;m hoping to use this for aligning text and audio, not Voice to Text or Voice commands.   My challenge now is to see if this process helps even if it is only 60% accurate.   But this spike solution is done, time to flesh out the rest of the code!</p>
]]></content:encoded>
			<wfw:commentRss>http://kingsoftwaredesigns.com/2010/02/voice-recognition-on-the-iphone/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>BrowserCMS</title>
		<link>http://kingsoftwaredesigns.com/2010/01/browsercms/</link>
		<comments>http://kingsoftwaredesigns.com/2010/01/browsercms/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 07:48:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kingsoftwaredesigns.com/?p=88</guid>
		<description><![CDATA[BrowserCMS is a new CMS system for rails that was &#8220;first&#8221; introduced in their talk at acts_as_conference 2009.   Watching the last 10 or so minutes will give you a feel for the Usage Model
A solid CMS solution for my clients is essential for my peace of mind!  There&#8217;s my value add which is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://browsercms.org/">BrowserCMS</a> is a new CMS system for rails that was &#8220;first&#8221; introduced in their talk at <a href="http://paulbarry.com/articles/2009/02/13/talk-on-browsercms-from-acts-as-conference">acts_as_conference 2009</a>.   Watching the last 10 or so minutes will give you a feel for the Usage Model</p>
<p>A solid CMS solution for my clients is essential for my peace of mind!  There&#8217;s my value add which is the web application, and then there&#8217;s the rest of the site.   Mixing and matching PHP CMS solutions or static HTML files has been the bane of my life for a while now.</p>
<p>One thing that I really enjoy about the project is that there&#8217;s a company committed to it&#8217;s success.   That&#8217;s one of the biggest deciders for me in any open-source project.   I loaded up the demo, and the UI looked very nice by default which is always encouraging.</p>
<p>So the final arbitor is to look under the hood and see what exactly is there.</p>
<ul>
<li><strong>Basic Design</strong></li>
</ul>
<p>BrowserCMS is composed of a library of behaviors and  MVC objects that utilize these behaviors.  These behaviors are usually pulled into the Model, and the CMS Framework allows the management of these various Models.   Then a site is constructed entirely with these model objects and managed by the CMS interface.   I loved how they <a href="http://github.com/browsermedia/browsercms/blob/master/db/demo/data.rb"> loaded </a> the demo site.</p>
<p>You can also add your own objects by subclassing ContentBlock.   I need to play around more to get a feel for how much work it is, but it looks like you will get a lot of knobs in the CMS system for versioning, publishing and connecting into the site map for &#8216;free&#8217;.</p>
<ul>
<li><strong>Code</strong></li>
</ul>
<p>All the code is very well laid out and readable.   I was largely interested in how they implemented Versioning, and it didn&#8217;t pervert the model it was versioning which I was curious about.   Basically the columns that you want versioned are specified and then another table keeps track of all the modified versioned columns.   All the features I investigated seemed to encapsulate specific features and function independently.</p>
<ul>
<li><strong>Community</strong></li>
</ul>
<p>I just jumped on the googlegroup, and decided to take on a little cleanup that I would like to see, just to get my hands wet.   Basically none of their Model objects are in the Cms Module, so I can&#8217;t have their code live along side my code temporarily while I do the migration.   I could easily just move my code around, but it seemed like a good excuse to get playing around with an opensource project!</p>
<ul>
<li><strong>Authentication</strong></li>
</ul>
<p>Out of the box permssions and groups works well.   It has an implementation generated from Restful Authentication.   It says &#8216;Use standard Authentication tools&#8217; on the wishlist, so we&#8217;ll see where that goes.</p>
<p>Also, for future, more public sites, I am hooked on open-ID logins, like the system provided by <a href="https://rpxnow.com/?ref=tagline">RPX</a> so hopefully the plugin system can support an open-id system.</p>
<p>Looking forward to playing around some more!</p>
]]></content:encoded>
			<wfw:commentRss>http://kingsoftwaredesigns.com/2010/01/browsercms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customizing UITableView</title>
		<link>http://kingsoftwaredesigns.com/2009/12/customizing-uitableview/</link>
		<comments>http://kingsoftwaredesigns.com/2009/12/customizing-uitableview/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 06:51:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tally Up]]></category>

		<guid isPermaLink="false">http://kingsoftwaredesigns.com/?p=74</guid>
		<description><![CDATA[While re-writing Tally Up, I wanted to flex some Core Animation code, and came up with a split-screen design, where the toolbar is in the middle, the people list is on top, and the expense list is on the bottom.  The first challenge with this design is that I want the list on the [...]]]></description>
			<content:encoded><![CDATA[<p>While re-writing Tally Up, I wanted to flex some Core Animation code, and came up with a split-screen design, where the toolbar is in the middle, the people list is on top, and the expense list is on the bottom.  The first challenge with this design is that I want the list on the top to fill up from the bottom &#8212; not the top down.   So with some advice from <a href="http://projectswithlove.com">Matt Gallagher</a> I whipped up a custom UIView and <code>-(void)layoutSubviews</code>, and sure enough, 20 minutes and 1 loop later, my people populate from the bottom Up!</p>
<ul>
<li><strong>Step 1: </strong>Customize UITableView</li>
<p><code><br />
@implementation KSBottomUpTableView</code></p>
<p><code><br />
- (void)layoutSubviews {<br />
[super layoutSubviews];</code></p>
<p><code> </code><code>double start = self.frame.size.height;<br />
for (UIView* child in [self subviews]) {<br />
CGRect f = child.frame;<br />
if ([child isKindOfClass:[UITableViewCell class]]) {<br />
f.origin.y = start = start - f.size.height;<br />
child.frame = f;<br />
}<br />
}<br />
}<br />
</code></p>
<li><strong>Step 2: </strong>Plug into IB</li>
<p>Quick change of the class name in Interface Builder</p>
<p><img class="aligncenter size-full wp-image-75" title="Screen shot 2009-12-31 at 1.13.28 AM" src="http://kingsoftwaredesigns.com/wp-content/uploads/2009/12/Screen-shot-2009-12-31-at-1.13.28-AM.png" alt="Screen shot 2009-12-31 at 1.13.28 AM" width="506" height="397" /></p>
<li><strong>Step 3: </strong>Build and Test</li>
<p>It works!<br />
<img class="aligncenter size-full wp-image-76" title="Screen shot 2009-12-31 at 1.23.49 AM" src="http://kingsoftwaredesigns.com/wp-content/uploads/2009/12/Screen-shot-2009-12-31-at-1.23.49-AM.png" alt="Screen shot 2009-12-31 at 1.23.49 AM" width="414" height="770" /></p>
<p>A few observations that surprised me:</p>
<ul>
<li>There were no UITableViewCells in the table prior to <code>[super layoutSubviews]</code> </li>
<p>               It seems very strange to me that a routine named layout creates the subviews, but I&#8217;m sure there&#8217;s a reason.   One bigger question that I do have however, is where in the event loop are the UITableCellView&#8217;s removed since every time layoutSubviews is called, it has no cells!</p>
<li>There are 2 UIImageView objects that are always children of the UITableView.</li>
<p>               I&#8217;m guessing these are something to do with the scroll bar?   The frame was <code>(0 0; 7 7)</code> and <code>(0 -230; 7 7)</code>;
</ul>
<li><strong>Next Steps for KSBottomUpTableView</strong></li>
<ul>
<li>Create empty rows on top</li>
<li>Overflow the table on the top, not the bottom</li>
</ul>
</ul>
<p>That&#8217;s all!   Tally Up has been stalled for far too long.  It&#8217;s great to have a simple little app get some use!  But I need to get an update out so I can bang out some of my other projects that are hatching.   Also, now that I have a blog up that I&#8217;m somewhat happy with, I&#8217;m going to focus more on using the blogging tool chain more.    </p>
<p>PS: If anyone knows how to make the code block not lose it&#8217;s formating in WordPress that would be awesome. </p>
]]></content:encoded>
			<wfw:commentRss>http://kingsoftwaredesigns.com/2009/12/customizing-uitableview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internationalization with Cocoa</title>
		<link>http://kingsoftwaredesigns.com/2008/10/internationalization-with-cocoa/</link>
		<comments>http://kingsoftwaredesigns.com/2008/10/internationalization-with-cocoa/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 15:54:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tally Up]]></category>

		<guid isPermaLink="false">http://kingsoftwaredesigns.com/internationalization-with-cocoa/</guid>
		<description><![CDATA[So It looks like 2/5&#8217;s of my downloads are from outside of the US, and the majority of my initial comments are Internationalization related.   So, I looked to internationalize, and it is as easy as it should be!   But most of the Documentation is Reference based, not examples.   And [...]]]></description>
			<content:encoded><![CDATA[<p>So It looks like 2/5&#8217;s of my downloads are from outside of the US, and the majority of my initial comments are Internationalization related.   So, I looked to internationalize, and it is as easy as it should be!   But most of the Documentation is Reference based, not examples.   And well, I much prefer to steal and refactor examples than to understand and learn, so I put these forth for future Internationalization people to steal from!</p>
<p>This <a href="http://developer.apple.com/iphone/library/documentation/MacOSX/Conceptual/BPInternational/BPInternational.html#//apple_ref/doc/uid/10000171">Document</a> Is the official documentation for Internationalization.   Good, dry reading.</p>
<p>These 3 steps are all I needed to do:</p>
<p>1) Convert XIB files:<br />
- Internationalize XIB files.   Select the XIB file in XCode, click the info button, and under general press &#8216;Make Localized&#8217;<br />
- Extract strings:<span style="font-style:italic;font-weight:bold"> ibtool -L MainWindow.xib &gt; ./MainWindow.strings</span><br />
- Translate: See Post below!<br />
- Re-create new XIB File:<span style="font-style:italic;font-weight:bold">ibtool -d de.lproj/MainMenu.strings English.lproj/MainMenu.nib -W French.lproj/MainMenu.nib</span><br />
2) Use NSLocalizedString wherever you have a user-visible string to display<br />
- Modify Code to use NSLocalizedString<br />
- Generate a Localized.strings file auto-matically with: <span style="font-style:italic;font-weight:bold">genstrings -o t1 *.m</span><br />
This tool is very cool, it actually parses your code and looks for where you use NSLocalizedString and it generates your key/value pairs from the code!<br />
- Translate and copy Localized.strings into the .lproj directories<br />
3) Use the Localized interfaces on any API objects you have.<br />
- For me, the only object was the NSNumberConverter.   I was using a direct number converter, and I realized that it took care of things for all locales even easier!</p>
<blockquote><p>formatter = [[NSNumberFormatter alloc] init];<br />
[formatter setNumberStyle:NSNumberFormatterCurrencyStyle];<br />
[formatter setLocale:[NSLocale currentLocale]];</p></blockquote>
<p>I applaud Apple in their toolchain.   It&#8217;s great that I can develop great user-friendly Apps in a developer-friendly environment!</p>
<p>Anyone else have any Internationalization Tips?</p>
]]></content:encoded>
			<wfw:commentRss>http://kingsoftwaredesigns.com/2008/10/internationalization-with-cocoa/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Internationalization Assistance!</title>
		<link>http://kingsoftwaredesigns.com/2008/10/internationalization-assistance/</link>
		<comments>http://kingsoftwaredesigns.com/2008/10/internationalization-assistance/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 13:59:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tally Up]]></category>

		<guid isPermaLink="false">http://kingsoftwaredesigns.com/internationalization-assistance/</guid>
		<description><![CDATA[Hi,    If you would like Tally Up to be localized for your language, please translate the following strings and post below!   This is one problem that I never really thought I&#8217;d have to tackle, but almost 2/5ths of downloads are coming from outside the US!
That&#8217;s a cool problem in my [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,<br />    If you would like Tally Up to be localized for your language, please translate the following strings and post below!   This is one problem that I never really thought I&#8217;d have to tackle, but almost 2/5ths of downloads are coming from outside the US!</p>
<p>That&#8217;s a cool problem in my book!</p>
<p>Actions<br />Active Tallies<br />Name<br />Cost<br />Split By<br />Paid By<br />Expense Totals<br />Specify People<br />Create New Expense<br />Current Expenses<br />No Expenses<br />Tally Summary<br />Send Tally<br />Email Tally Summary<br />Add Person to Tally<br />People in Tally<br />No People Specified<br />Quick Add<br />Name or Initials<br />From Contacts<br />Nobody<br />Required<br />Must Enter Cost</p>
<p>The following I want to put some context around since  a direct translation may not work:</p>
<p>&lt;Name&gt; owes &lt;Amount&gt;<br />&lt;Name&gt; is owed &lt;Amount&gt;<br />&lt;Amount&gt; for &lt;Expense Name&gt;<br />&lt;Name&gt; is out</p>
<p>   Thanks for your help.</p>
]]></content:encoded>
			<wfw:commentRss>http://kingsoftwaredesigns.com/2008/10/internationalization-assistance/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>First iPhone App Submitted!</title>
		<link>http://kingsoftwaredesigns.com/2008/09/first-iphone-app-submitted/</link>
		<comments>http://kingsoftwaredesigns.com/2008/09/first-iphone-app-submitted/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 15:37:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tally Up]]></category>

		<guid isPermaLink="false">http://kingsoftwaredesigns.com/first-iphone-app-submitted/</guid>
		<description><![CDATA[After a fair deal of wrestling with the submission process, Tally Up has been submitted to the App store.   I hope that some people discover it and find it useful!
Many Thanks to:
David RussellSteve BeckwithJamie Sutton
]]></description>
			<content:encoded><![CDATA[<p>After a fair deal of wrestling with the submission process, Tally Up has been submitted to the App store.   I hope that some people discover it and find it useful!</p>
<p>Many Thanks to:</p>
<p>David Russell<br />Steve Beckwith<br />Jamie Sutton</p>
]]></content:encoded>
			<wfw:commentRss>http://kingsoftwaredesigns.com/2008/09/first-iphone-app-submitted/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
	</channel>
</rss>

