<?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>KDBDallas &#187; Objective-C</title>
	<atom:link href="http://kdbdallas.com/category/objective-c/feed/" rel="self" type="application/rss+xml" />
	<link>http://kdbdallas.com</link>
	<description>Mac and iPhone Developer, Husband, Father, all in one</description>
	<lastBuildDate>Thu, 17 Jun 2010 22:27:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Very Very Classy</title>
		<link>http://kdbdallas.com/2010/06/17/very-very-classy/</link>
		<comments>http://kdbdallas.com/2010/06/17/very-very-classy/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 22:25:49 +0000</pubDate>
		<dc:creator>Dallas</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Cocoa Touch]]></category>
		<category><![CDATA[Fanboy]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[WWDC]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://kdbdallas.com/?p=324</guid>
		<description><![CDATA[I was VERY disappointed that I was unable to make it to Apple&#8217;s WWDC (World Wide Developer Conference) this year (it was last week).
The sessions are always VERY informative, but it is also a excellent chance to not only meet with other Mac/iOS developers, but you have the chance to talk one on one with [...]]]></description>
			<content:encoded><![CDATA[<p>I was VERY disappointed that I was unable to make it to Apple&#8217;s WWDC (World Wide Developer Conference) this year (it was last week).</p>
<p>The sessions are always VERY informative, but it is also a excellent chance to not only meet with other Mac/iOS developers, but you have the chance to talk one on one with the very people who are writing the software and API&#8217;s (Application Programming Interface) that we write software for/with.</p>
<p>Apple does make the videos of the sessions (along with the slides) available to everyone that attends, and allows those that didn&#8217;t attend to purchase the videos.<br />
Before last year, these videos usually took around 6 months to become available, however last year they had them released within a month.</p>
<p>This year Apple TOTALLY outdid themselves and have released the videos all today!<br />
That is LESS than 1 week!<br />
Not only did they release everything within a week, but Apple has made all of the videos and slides available to ALL registered developers (even the free developer accounts) FOR FREE!!! That is a $500 savings for those that couldn&#8217;t attend!</p>
<p>I only have 2 things to say&#8230;</p>
<p>First: Good bye to my Hard Drive space <img src='http://kdbdallas.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  (The videos are available in HD and Standard formats this year)</p>
<p>and Secondly&#8230; Classy Apple! VERY VERY CLASSY!</p>
<p><em>Reminder: Even though the videos did not cost this year, they are still covered under an NDA that you agree to when signing up for a developer account. Don&#8217;t make them sorry that they were so giving.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://kdbdallas.com/2010/06/17/very-very-classy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Core Data Speed Gotcha</title>
		<link>http://kdbdallas.com/2009/12/31/core-data-speed-gotcha/</link>
		<comments>http://kdbdallas.com/2009/12/31/core-data-speed-gotcha/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 17:16:59 +0000</pubDate>
		<dc:creator>Dallas</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Cocoa Touch]]></category>
		<category><![CDATA[Core Data]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://kdbdallas.com/?p=296</guid>
		<description><![CDATA[Recently I was doing some performance stress testing on my upcoming iPhone app, Newsprint, and ran into a little Core Data gotcha that I thought I would document for both myself and for Google to index for others.
Special thanks to Jeff LaMarche for guiding me in the right direction to figure this out. You can [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was doing some performance stress testing on my upcoming iPhone app, Newsprint, and ran into a little Core Data gotcha that I thought I would document for both myself and for Google to index for others.</p>
<p><strong>Special thanks to Jeff LaMarche for guiding me in the right direction to figure this out. You can find his blog at: <a href="http://iphonedevelopment.blogspot.com/">http://iphonedevelopment.blogspot.com/</a></strong></p>
<p>This issue came to play when I needed to do a fetch request from Core Data and then run a couple of Predicate &#8220;searches&#8221;/&#8221;filtering&#8221; on the data.</p>
<p>My original thought was that doing a single fetch request and then running my different predicates on the returned set of objects would have better performance then doing multiple fetch requests since I would only have to pull from the Core Data SQLite DB once and then I would have everything in memory and I could just simply manipulate it.</p>
<p>Turns out that this is HIGHLY incorrect.</p>
<p>If instead you just do multiple fetch requests and implement your predicate into your fetch request, that Core Data and SQLite are smart enough to scan the records more efficiently and without causing Core Data Faults to fire.</p>
<p>This gives a MASSIVE speed increase!</p>
<p>So if you are ever doing something similar, make sure to check this method and see if it to can speed your app up.</p>
]]></content:encoded>
			<wfw:commentRss>http://kdbdallas.com/2009/12/31/core-data-speed-gotcha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cocoa Touch for iPhone OS 3, Now Shipping!</title>
		<link>http://kdbdallas.com/2009/11/19/cocoa-touch-for-iphone-os-3-now-shipping/</link>
		<comments>http://kdbdallas.com/2009/11/19/cocoa-touch-for-iphone-os-3-now-shipping/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 23:02:52 +0000</pubDate>
		<dc:creator>Dallas</dc:creator>
				<category><![CDATA[App Store]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa Touch]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://kdbdallas.com/?p=279</guid>
		<description><![CDATA[The book that I was the Technical Editor for, Cocoa Touch for iPhone OS 3, is now shipping from Amazon.com and should also be in (hopefully) most Barnes and Nobles.
View it at Amazon.com by clicking here.
This book is great for new iPhone developers as well as experienced ones.
You will need some Objective-C knowledge, but if [...]]]></description>
			<content:encoded><![CDATA[<p>The book that I was the Technical Editor for, Cocoa Touch for iPhone OS 3, is now shipping from Amazon.com and should also be in (hopefully) most Barnes and Nobles.<br />
<a href="http://www.amazon.com/dp/0470481072" target="_blank">View it at Amazon.com by clicking here.</a></p>
<p>This book is great for new iPhone developers as well as experienced ones.<br />
You will need some Objective-C knowledge, but if you have some OOP (Object Oriented Programming) experience you should be ok with picking up an Objective-C book as well for as you work through the book.</p>
<p>If you are in a B&#038;N stroll into the Geek, err, I mean Computer Programming section and look for the book.<br />
Feel free to buy a copy to support my good friend and author of the book, Jiva DeVoe.<br />
If you can&#8217;t get yourself to that level of geek, at least pick it up and look at the &#8216;Credits&#8217; page, right before the Table of Contents and then you can go around to all the geeks in that area and say, &#8220;I KNOW THIS GUY!&#8221; <img src='http://kdbdallas.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>This makes 2 iPhone development books that I have been involved in, each one with more of a role than the last, however I can safely say it will be my last as after being involved with the book writing processes and having the author be a close friend of mine, I don&#8217;t really have a desire to write one myself (unless it&#8217;s an offer I just can&#8217;t refuse).</p>
<p><a href="http://kdbdallas.com/wp-content/uploads/2009/11/cocoaTouchForIPhone.png"><img src="http://kdbdallas.com/wp-content/uploads/2009/11/cocoaTouchForIPhone.png" alt="cocoaTouchForIPhone" title="cocoaTouchForIPhone" width="300" height="376" class="aligncenter size-full wp-image-280" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://kdbdallas.com/2009/11/19/cocoa-touch-for-iphone-os-3-now-shipping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coming Soon to a Bookstore Near You</title>
		<link>http://kdbdallas.com/2009/05/05/coming-soon-to-a-bookstore-near-you/</link>
		<comments>http://kdbdallas.com/2009/05/05/coming-soon-to-a-bookstore-near-you/#comments</comments>
		<pubDate>Tue, 05 May 2009 21:56:12 +0000</pubDate>
		<dc:creator>Dallas</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa Touch]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://kdbdallas.com/?p=213</guid>
		<description><![CDATA[I have been offered a gig of being the Technical Editor for an upcoming iPhone programming book.
The book is called &#8220;Cocoa Touch for iPhone 3.0&#8243; and is being written by my friend Jiva DeVoe and published by Wiley and Sons Publishing.
You can visit the current pre-emptive webpage for the book at: http://www.wiley.com/WileyCDA/WileyTitle/productCd-0470481072.html
I was previously a [...]]]></description>
			<content:encoded><![CDATA[<p>I have been offered a gig of being the Technical Editor for an upcoming iPhone programming book.</p>
<p>The book is called &#8220;Cocoa Touch for iPhone 3.0&#8243; and is being written by my friend <a href="http://www.random-ideas.net/">Jiva DeVoe</a> and published by <a href="http://www.wiley.com/WileyCDA/">Wiley and Sons Publishing</a>.</p>
<p>You can visit the current pre-emptive webpage for the book at: <a href="http://www.wiley.com/WileyCDA/WileyTitle/productCd-0470481072.html">http://www.wiley.com/WileyCDA/WileyTitle/productCd-0470481072.html</a></p>
<p>I was previously a Technical Reviewer for the programming book: <a href="http://my.safaribooksonline.com/9780596156282/preface#acknowledgments">iPhone SDK Application Development, 1st Edition</a></p>
<p>It will be interesting the see the differences between being a technical reviewer and a technical editor.</p>
]]></content:encoded>
			<wfw:commentRss>http://kdbdallas.com/2009/05/05/coming-soon-to-a-bookstore-near-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ChocTop</title>
		<link>http://kdbdallas.com/2009/03/01/choctop/</link>
		<comments>http://kdbdallas.com/2009/03/01/choctop/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 04:53:06 +0000</pubDate>
		<dc:creator>Dallas</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Programs]]></category>

		<guid isPermaLink="false">http://kdbdallas.com/?p=182</guid>
		<description><![CDATA[I have been finalizing the beta for iDeskCal 2.0 and in the process came across ChocTop.
ChocTop is a system for rapid mac software DMG packaging.
In setting it up and using it I found that it lacked a feature I wanted.
Mainly the ability to specify that it should you a Debug build instead of the standard [...]]]></description>
			<content:encoded><![CDATA[<p>I have been finalizing the beta for iDeskCal 2.0 and in the process came across ChocTop.</p>
<p>ChocTop is a system for rapid mac software DMG packaging.</p>
<p>In setting it up and using it I found that it lacked a feature I wanted.<br />
Mainly the ability to specify that it should you a Debug build instead of the standard Release build that you would usually use.<br />
The reason for wanting a Debug build is simple&#8230; I am packaging up a Beta.</p>
<p>So even though I don&#8217;t know Ruby (which is what ChocTop is written in) I set foot to add this feature.<br />
Luckily like most computer languages I was able to understand it enough to understand what was going on and enough to add this new ability.</p>
<p>Once I was done and used it myself, I sent it back into the developer and he has already integrated it into the repo version of the code.</p>
<p>If you are a Mac developer checkout <a href="http://drnic.github.com/choctop/">http://drnic.github.com/choctop/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kdbdallas.com/2009/03/01/choctop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Log all accessed methods in Objective-C with DTrace</title>
		<link>http://kdbdallas.com/2009/02/07/log-all-accessed-methods-in-objective-c-with-dtrace/</link>
		<comments>http://kdbdallas.com/2009/02/07/log-all-accessed-methods-in-objective-c-with-dtrace/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 07:10:46 +0000</pubDate>
		<dc:creator>Dallas</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Cocoa Touch]]></category>
		<category><![CDATA[DTrace]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://kdbdallas.com/?p=173</guid>
		<description><![CDATA[I have recently been debugging some Objective-C and Cocoa/Cocoa Touch code.
Not being familiar with all the code and with a TON of methods being accessed in milliseconds, my attempts at stepping through the code just wasn&#8217;t working, as clicking &#8216;Step Into&#8217; as fast as I could keep up and over an hour of stepping through [...]]]></description>
			<content:encoded><![CDATA[<p>I have recently been debugging some Objective-C and Cocoa/Cocoa Touch code.</p>
<p>Not being familiar with all the code and with a TON of methods being accessed in milliseconds, my attempts at stepping through the code just wasn&#8217;t working, as clicking &#8216;Step Into&#8217; as fast as I could keep up and over an hour of stepping through I was still not even close to figuring out what I needed to know.</p>
<p>This lead me to the thought of logging every method that was accessed and then I could step look through it and skip around as needed.<br />
However with 60 some odd files and say maybe 20 methods in each file, that would take a lot of NSLog&#8217;s.<br />
I started looking around and was pointed to bbums blog about <a href="http://www.friday.com/bbum/2008/01/01/objective-c-a-hack-to-log-all-methods/">doing something similar</a>.<br />
However it still would take adding some code, plus I couldn&#8217;t get it working right with the iPhone.</p>
<p>This lead me to wonder about <a href="http://en.wikipedia.org/wiki/Dtrace">DTrace</a>.<br />
After a recent podcast from <a href="http://twitter.com/macdevnet">Scotty</a> at the <a href="http://www.mac-developer-network.com/">Mac Developer Network</a>, featuring <a href="http://cocoasamurai.blogspot.com/">Colin Wheeler</a> talking about DTrace, I have been very interested in learning more about DTrace.</p>
<p>The difficult thing I have been finding is that since DTrace was originally written for Sun, it is hard to find info related to MacOS and more so Cocoa.</p>
<p>I then found a video from Colin about using DTrace with Cocoa and XCode.<br />
<a href="http://www.viddler.com/explore/Machx/videos/8">http://www.viddler.com/explore/Machx/videos/8</a></p>
<p>I wasn&#8217;t able to get what I wanted working, so I hit <a href="http://twitter.com/CocoaSamurai">Colin up on Twitter</a> and then talked to him a bit in email and he pointed me to the <strong>Golden Solution</strong>!</p>
<p>The solution is:<br />
<code>objc$target:::entry{}</code></p>
<p>So I took that and created a DTrace script.<br />
You can grab it here:<br />
<a href='http://kdbdallas.com/wp-content/uploads/2009/02/logallmethodsd.zip'>http://kdbdallas.com/wp-content/uploads/2009/02/logallmethodsd.zip</a></p>
<p>To run it open Terminal and run:<br />
sudo ./logAllMethods.d -p PID</p>
<p>Of course replacing &#8216;PID&#8217; with the PID of your running program and remembering that for DTrace &#8217;sudo&#8217; is required.</p>
<p>Also note that this works for iPhone programs running in the iPhone Simulator.<br />
Just look for the PID of your iPhone app within Activity Monitor once it&#8217;s running in the simulator.</p>
<p>Be careful as depending on the program it can spit out a TON of data VERY quickly.</p>
<p>Running this against Adium for only a fraction of a second gave me a couple hundred lines of output.</p>
<p>The output looks like this:</p>
<p>tesseract:Desktop dallas$ sudo ./logAllMethods.d -p 4371<br />
dtrace: script &#8216;./logAllMethods.d&#8217; matched 71222 probes<br />
CPU     ID                    FUNCTION:NAME<br />
  0  59398                    -retain:entry<br />
  0  34684                    +retain:entry<br />
  0  32061            +idleAllMovies::entry<br />
  0  32062                      -idle:entry<br />
  0  34707                    -retain:entry<br />
  0  32914       -_usingVisualContext:entry<br />
  0  32878        -_resyncNaturalSize:entry<br />
  0  31935                 -loadState:entry<br />
  0  31972               -naturalSize:entry</p>
<p>Hopefully this helps someone out there.<br />
Just remember always use the info I post for good.<br />
(or if its for evil make sure it profitable and then send me a cut)</p>
<p>Once again, special thanks to Colin Wheeler.</p>
]]></content:encoded>
			<wfw:commentRss>http://kdbdallas.com/2009/02/07/log-all-accessed-methods-in-objective-c-with-dtrace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>White Indeterminate Progress Indicator (AKA: White NSProgressIndicator)</title>
		<link>http://kdbdallas.com/2008/12/28/white-indeterminate-progress-indicator-aka-white-nsprogressindicator/</link>
		<comments>http://kdbdallas.com/2008/12/28/white-indeterminate-progress-indicator-aka-white-nsprogressindicator/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 05:49:23 +0000</pubDate>
		<dc:creator>Dallas</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[NSProgressIndicator]]></category>
		<category><![CDATA[Source Code]]></category>

		<guid isPermaLink="false">http://kdbdallas.com/?p=151</guid>
		<description><![CDATA[If you have ever wanted to use a Indeterminate Spinner NSProgressIndicator on a dark background you have probably been upset to find that there is no way to get a white spinner.
That is where WhiteIntermProgIndicator comes into play.
WhiteIntermProgIndicator, is based off of AMIndeterminateProgressIndicatorCell by Andreas at Harmless Cocoa.
Screenshot:

Download: WhiteIntermProgIndicator.zip
]]></description>
			<content:encoded><![CDATA[<p>If you have ever wanted to use a Indeterminate Spinner NSProgressIndicator on a dark background you have probably been upset to find that there is no way to get a white spinner.<br />
That is where WhiteIntermProgIndicator comes into play.<br />
WhiteIntermProgIndicator, is based off of AMIndeterminateProgressIndicatorCell by Andreas at <a href="http://www.harmless.de">Harmless Cocoa</a>.</p>
<p><strong>Screenshot:</strong><br />
<img src="http://kdbdallas.com/wp-content/uploads/2008/12/whiteintermprogindicator.png" alt="whiteintermprogindicator" title="whiteintermprogindicator" width="44" height="39" class="alignnone size-full wp-image-149" /></p>
<p><strong>Download:</strong> <a href="http://www.kdbdallas.com/Code/WhiteIntermProgIndicator.zip">WhiteIntermProgIndicator.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kdbdallas.com/2008/12/28/white-indeterminate-progress-indicator-aka-white-nsprogressindicator/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mac/iPhone: Show Available Usable Disk Space</title>
		<link>http://kdbdallas.com/2008/12/27/maciphone-show-availble-useable-diskspace/</link>
		<comments>http://kdbdallas.com/2008/12/27/maciphone-show-availble-useable-diskspace/#comments</comments>
		<pubDate>Sun, 28 Dec 2008 00:18:53 +0000</pubDate>
		<dc:creator>Dallas</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Cocoa]]></category>

		<guid isPermaLink="false">http://kdbdallas.com/?p=102</guid>
		<description><![CDATA[If you have an application that allows users to upload content to the app, you might want to show the user how much space is available for them to use.
This is especially true on the iPhone where it is not as easy for the user to quickly check if they have enough room to upload [...]]]></description>
			<content:encoded><![CDATA[<p>If you have an application that allows users to upload content to the app, you might want to show the user how much space is available for them to use.</p>
<p>This is especially true on the iPhone where it is not as easy for the user to quickly check if they have enough room to upload a given file.</p>
<p>You may also want to check if there is enough space before you start the upload, so you can inform them that the file wont fit.</p>
<p>That brings you to the task of figuring out how much free space there is, and more importantly how much free space is left that you as an unprivileged program can access.</p>
<p>The following code is based towards the iPhone, however all that would be needed to change it to be used on the Mac is the location you are checking for free space, and the setting of the label.</p>
<p><strong>NOTE:</strong> <em>The below &#8220;shown&#8221; code is old. The updated code is in the zip file at the bottom</em></p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#include &lt;sys/param.h&gt;</span>
<span style="color: #6e371a;">#include &lt;sys/mount.h&gt;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>sizeType;
&nbsp;
<span style="color: #a61390;">float</span> availableDisk;
&nbsp;
<span style="color: #400080;">NSArray</span> <span style="color: #002200;">*</span>paths <span style="color: #002200;">=</span> NSSearchPathForDirectoriesInDomains<span style="color: #002200;">&#40;</span>NSDocumentDirectory, NSUserDomainMask, <span style="color: #a61390;">YES</span><span style="color: #002200;">&#41;</span>;
&nbsp;
<span style="color: #a61390;">struct</span> statfs tStats;
&nbsp;
statfs<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>paths lastObject<span style="color: #002200;">&#93;</span> cString<span style="color: #002200;">&#93;</span>, <span style="color: #002200;">&amp;</span>tStats<span style="color: #002200;">&#41;</span>;
&nbsp;
availableDisk <span style="color: #002200;">=</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">float</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#40;</span>tStats.f_bavail <span style="color: #002200;">*</span> tStats.f_bsize<span style="color: #002200;">&#41;</span>;
&nbsp;
<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>availableDisk &gt; <span style="color: #2400d9;">1024</span><span style="color: #002200;">&#41;</span>
<span style="color: #002200;">&#123;</span>
	<span style="color: #11740a; font-style: italic;">//Kilobytes</span>
	availableDisk <span style="color: #002200;">=</span> availableDisk <span style="color: #002200;">/</span> <span style="color: #2400d9;">1024</span>;
&nbsp;
	sizeType <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot; KB&quot;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>availableDisk &gt; <span style="color: #2400d9;">1024</span><span style="color: #002200;">&#41;</span>
<span style="color: #002200;">&#123;</span>
	<span style="color: #11740a; font-style: italic;">//Megabytes</span>
	availableDisk <span style="color: #002200;">=</span> availableDisk <span style="color: #002200;">/</span> <span style="color: #2400d9;">1024</span>;
&nbsp;
	sizeType <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot; MB&quot;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>availableDisk &gt; <span style="color: #2400d9;">1024</span><span style="color: #002200;">&#41;</span>
<span style="color: #002200;">&#123;</span>
	<span style="color: #11740a; font-style: italic;">//Gigabytes</span>
	availableDisk <span style="color: #002200;">=</span> availableDisk <span style="color: #002200;">/</span> <span style="color: #2400d9;">1024</span>;
&nbsp;
	sizeType <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot; GB&quot;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
diskSpaceLbl.text <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Available Disk Space: &quot;</span> stringByAppendingFormat<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;%.2f&quot;</span>, availableDisk<span style="color: #002200;">&#93;</span> stringByAppendingString<span style="color: #002200;">:</span>sizeType<span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>This will give you something like the following:</p>
<p><img class="alignnone size-full wp-image-104" title="availablediskspace" src="http://kdbdallas.com/wp-content/uploads/2008/12/availablediskspace.png" alt="availablediskspace" width="257" height="29" /></p>
<p><strong><em>UPDATE:</em></strong><br />
I have gone a step further and made this into an easy to use class, that works out of the box with the iPhone and the Mac.</p>
<p><a href='http://www.kdbdallas.com/Code/FSStats.zip'><img src="http://kdbdallas.com/wp-includes/images/crystal/archive.png"/></a> <a href='http://www.kdbdallas.com/Code/FSStats.zip'>FSStats.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kdbdallas.com/2008/12/27/maciphone-show-availble-useable-diskspace/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Pi Presentation: SQLite</title>
		<link>http://kdbdallas.com/2008/12/04/pi-presentation-sqlite/</link>
		<comments>http://kdbdallas.com/2008/12/04/pi-presentation-sqlite/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 19:20:18 +0000</pubDate>
		<dc:creator>Dallas</dc:creator>
				<category><![CDATA[Cocoa Touch]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Pi]]></category>
		<category><![CDATA[SQLite]]></category>

		<guid isPermaLink="false">http://kdbdallas.com/?p=62</guid>
		<description><![CDATA[Last night I gave a presentation at the Phoenix iPhone Developers Group (Pi) on SQLite.
I am posting the presentation and sample code here for anyone who is interested.
Please note that this is by no means the &#8220;proper&#8221; or only way of doing things. This is simply one way of doing it, and is for reference [...]]]></description>
			<content:encoded><![CDATA[<p>Last night I gave a presentation at the Phoenix iPhone Developers Group (Pi) on SQLite.</p>
<p>I am posting the presentation and sample code here for anyone who is interested.</p>
<p><em>Please note that this is by no means the &#8220;proper&#8221; or only way of doing things. This is simply one way of doing it, and is for reference purposes only. The code uses the FMDB SQLite Wrapper.</em></p>
<p><a href="http://kdbdallas.com/wp-content/uploads/2008/12/example.zip"><img class="alignnone" title="archive" src="http://kdbdallas.com/wp-includes/images/crystal/archive.png" alt="" width="46" height="60" /></a> Example Code: (<a href="http://kdbdallas.com/wp-content/uploads/2008/12/example.zip">example.zip</a>)</p>
<p><a href="http://kdbdallas.com/wp-content/uploads/2008/12/sqlite-presentation.zip"><img class="alignnone" title="archive" src="http://kdbdallas.com/wp-includes/images/crystal/archive.png" alt="" width="46" height="60" /></a> Keynote Presentation (<a href="http://kdbdallas.com/wp-content/uploads/2008/12/sqlite-presentation.zip">sqlite-presentation.zip</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://kdbdallas.com/2008/12/04/pi-presentation-sqlite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Phoenix NSCoder Night</title>
		<link>http://kdbdallas.com/2008/10/26/phoenix-nscoder-night/</link>
		<comments>http://kdbdallas.com/2008/10/26/phoenix-nscoder-night/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 04:29:45 +0000</pubDate>
		<dc:creator>Dallas</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[NSCoder Night]]></category>

		<guid isPermaLink="false">http://kdbdallas.com/?p=57</guid>
		<description><![CDATA[I am proud to introduce NSCoder Night for Phoenix.
If you haven&#8217;t heard of NSCoder Night, here is a brief intro (partially borrowed from the website)
NSCoder Night is a weekly event where Cocoa developers come together for some coding and camaraderie in the relaxed atmosphere of a coffee shop or pub with a wireless network.
Unlike more [...]]]></description>
			<content:encoded><![CDATA[<p>I am proud to introduce NSCoder Night for Phoenix.</p>
<p>If you haven&#8217;t heard of NSCoder Night, here is a brief intro (partially borrowed from the website)</p>
<p>NSCoder Night is a weekly event where Cocoa developers come together for some coding and camaraderie in the relaxed atmosphere of a coffee shop or pub with a wireless network.<br />
Unlike more formal meetings like CocoaHeads there is no presentation, just hanging out with other (similar interest) geeks and working on your own projects or group projects. It is a great way to gain a IRL (in real life) friendship with other developers, as well as getting help on something you are stuck on.</p>
<p>It is kind of similar to how we go somewhere after XCodePhoenix meetings, but with your laptops and more frequently.</p>
<p>As there is no presentation it is a low key come and leave as you need type of meet-up.<br />
If you can&#8217;t make it one week, thats ok, make it the next week.</p>
<p>The Phoenix chapter of NSCoder Night will be meeting Tuesdays at 7pm at Coffee Rush @ Gilbert and Baseline in Gilbert.</p>
<p>Fell free to to tell all your dev friends and we hope to see you there.</p>
]]></content:encoded>
			<wfw:commentRss>http://kdbdallas.com/2008/10/26/phoenix-nscoder-night/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
