<?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>David Beck&#039;s Blog &#187; Programming</title>
	<atom:link href="http://davidbeckblog.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidbeckblog.com</link>
	<description>The ramblings of an obsessed programmer</description>
	<lastBuildDate>Thu, 22 Jul 2010 18:01:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>CGInsetRect</title>
		<link>http://davidbeckblog.com/2009/09/cginsetrect/</link>
		<comments>http://davidbeckblog.com/2009/09/cginsetrect/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 16:03:57 +0000</pubDate>
		<dc:creator>David Beck</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://davidbeckblog.com/?p=82</guid>
		<description><![CDATA[I titled this post as such because I am hoping to help others that are in the situation I was in. Go ahead and Google &#8220;CGInsetRect&#8221;. When I did, I got 0 results. Not a single page has anything on it. The reason? While on Mac OS X you would call NSInsetRect, on iPhone you [...]]]></description>
			<content:encoded><![CDATA[<p>I titled this post as such because I am hoping to help others that are in the situation I was in. Go ahead and Google &#8220;CGInsetRect&#8221;. When I did, I got 0 results. Not a single page has anything on it. The reason? While on Mac OS X you would call NSInsetRect, on iPhone you use CGRects. They are almost identical including having the same function set. The catch? NSRects functions all use the naming convention NSFunctionRect. CGRects on the other hand, as I forgot, use CGRectFunction.<br />
<span id="more-82"></span> For everyone looking for the function above, use CGRectInset.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidbeckblog.com/2009/09/cginsetrect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NSTableView, NSArrayController and editing new rows</title>
		<link>http://davidbeckblog.com/2009/05/nstableview-nsarraycontroller-and-editing-new-rows/</link>
		<comments>http://davidbeckblog.com/2009/05/nstableview-nsarraycontroller-and-editing-new-rows/#comments</comments>
		<pubDate>Mon, 11 May 2009 06:42:59 +0000</pubDate>
		<dc:creator>David Beck</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Bindings]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Objective C]]></category>

		<guid isPermaLink="false">http://davidbeckblog.com/?p=29</guid>
		<description><![CDATA[This is the only solution I could find that would allow you to automatically edit newly added rows when using bindings with an NSArrayController and an NSTableView.]]></description>
			<content:encoded><![CDATA[<p>Figured out a very nice solution to automatically edit new rows added by NSArrayControllers via bindings! I searched for a while and didn&#8217;t find any correct solutions, so I made my own.<br />
<span id="more-29"></span><br />
The problem is that any catch that you would normally use, including subclassing, wont work because NSArrayController defers changes until the next run loop.</p>
<p>I have a table which my object is the delegate of. The table is bound to the array controller. The array of the array controller is filled with <strong>NSMutableDictionarys</strong>.</p>
<p>So I have</p>
<p>Here&#8217;s what I did:</p>
<pre>- (void)tableViewSelectionDidChange:(NSNotification *)aNotification
{
	if([[[data objectAtIndex:[table selectedRow]] allKeys] count] == 0)
		[table editColumn:0 row:[table selectedRow] withEvent:nil select:YES];
}</pre>
<p>First we become the delegate of the table and implement the tableViewSelectionDidChange: method which is sent <em>after </em>the selection is changed. Then we check if the object (an NSMutableDictionary) has any keys set. If no keys are set, we assume that the row is new. This is different than if the keys were set to empty strings. editColumn:row:withEvent:select: scrolls to the row and column and starts editing the cell.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidbeckblog.com/2009/05/nstableview-nsarraycontroller-and-editing-new-rows/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
