<?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>Tewha &#187; objective-c</title>
	<atom:link href="http://tewha.net/tag/objective-c/feed/" rel="self" type="application/rss+xml" />
	<link>http://tewha.net</link>
	<description>Writings and links on iPhone and iPad programming</description>
	<lastBuildDate>Wed, 18 Apr 2012 20:26:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Blocks to remove redundancy</title>
		<link>http://tewha.net/2011/07/blocks-to-remove-redundancy/</link>
		<comments>http://tewha.net/2011/07/blocks-to-remove-redundancy/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 15:25:56 +0000</pubDate>
		<dc:creator>Steven Fisher</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[blocks]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://tewha.net/?p=1166</guid>
		<description><![CDATA[Blocks have many complicated uses, from event-based code to multithreading. But they can also be used for very trivial tasks, such as removing redundant lines from code. Here&#8217;s a common operation for me: Split a list into sublists based on &#8230; <a href="http://tewha.net/2011/07/blocks-to-remove-redundancy/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Blocks have many complicated uses, from event-based code to multithreading. But they can also be used for very trivial tasks, such as removing redundant lines from code.</p>

<p>Here&#8217;s a common operation for me: Split a list into sublists based on some piece of data changing within a loop. When the loop is over, dump whatever&#8217;s left into another sublist.</p>

<p>Without blocks, this looks like this:</p>

<div class="highlight-wrapper objc">
<div class="tools">
<div class="wrap">
<a href="#" class="about">?</a><div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<pre class="raw"><code lang="objc">
- (NSArray *)splitArray: (NSArray *)array
               valueKey: (NSString *)valueKey
               labelKey: (NSString *)labelKey;
{
    id sections = [NSMutableArray array];
    id sectionValue = nil;
    id sectionRecords = [NSMutableArray array];
    
    for (id record in array) {
        id recordValue = [record objectForKey: valueKey];
        if ( ![recordValue isEqual: sectionValue] ) {
            if ( [sectionRecords count] ) {
                id lastRecord = [sectionRecords objectAtIndex: 0];
                id label = [lastRecord objectForKey: labelKey];
                id section = [NSDictionary dictionaryWithObjectsAndKeys:
                              [NSArray arrayWithArray: sectionRecords], @"Records",
                              label, @"Name",
                              nil];
                [sections addObject: section];
                [sectionRecords removeAllObjects];
            }
            sectionValue = recordValue;
        }
        [sectionRecords addObject: record];
    }
    if ( [sectionRecords count] ) {
        id lastRecord = [sectionRecords objectAtIndex: 0];
        id label = [lastRecord objectForKey: labelKey];
        id section = [NSDictionary dictionaryWithObjectsAndKeys:
                      [NSArray arrayWithArray: sectionRecords], @"Records",
                      label, @"Name",
                      nil];
        [sections addObject: section];
        [sectionRecords removeAllObjects];
    }
    
    return [NSArray arrayWithArray: sections];
}
</code></pre>
<div class="highlighted"><table class="highlighttable"><tr>
<td class="linenos"><div class="linenodiv"><pre class="nl"> 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38</pre></div></td>
<td class="code">
<div class="highlight"><pre><span class="o">-</span> <span class="p">(</span><span class="n">NSArray</span> <span class="o">*</span><span class="p">)</span><span class="nl">splitArray:</span> <span class="p">(</span><span class="n">NSArray</span> <span class="o">*</span><span class="p">)</span><span class="n">array</span>
               <span class="nl">valueKey:</span> <span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="n">valueKey</span>
               <span class="nl">labelKey:</span> <span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="n">labelKey</span><span class="p">;</span>
<span class="p">{</span>
    <span class="kt">id</span> <span class="n">sections</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSMutableArray</span> <span class="n">array</span><span class="p">];</span>
    <span class="kt">id</span> <span class="n">sectionValue</span> <span class="o">=</span> <span class="nb">nil</span><span class="p">;</span>
    <span class="kt">id</span> <span class="n">sectionRecords</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSMutableArray</span> <span class="n">array</span><span class="p">];</span>
    
    <span class="k">for</span> <span class="p">(</span><span class="kt">id</span> <span class="n">record</span> <span class="k">in</span> <span class="n">array</span><span class="p">)</span> <span class="p">{</span>
        <span class="kt">id</span> <span class="n">recordValue</span> <span class="o">=</span> <span class="p">[</span><span class="n">record</span> <span class="nl">objectForKey:</span> <span class="n">valueKey</span><span class="p">];</span>
        <span class="k">if</span> <span class="p">(</span> <span class="o">!</span><span class="p">[</span><span class="n">recordValue</span> <span class="nl">isEqual:</span> <span class="n">sectionValue</span><span class="p">]</span> <span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span> <span class="p">[</span><span class="n">sectionRecords</span> <span class="n">count</span><span class="p">]</span> <span class="p">)</span> <span class="p">{</span>
                <span class="kt">id</span> <span class="n">lastRecord</span> <span class="o">=</span> <span class="p">[</span><span class="n">sectionRecords</span> <span class="nl">objectAtIndex:</span> <span class="mi">0</span><span class="p">];</span>
                <span class="kt">id</span> <span class="n">label</span> <span class="o">=</span> <span class="p">[</span><span class="n">lastRecord</span> <span class="nl">objectForKey:</span> <span class="n">labelKey</span><span class="p">];</span>
                <span class="kt">id</span> <span class="n">section</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSDictionary</span> <span class="nl">dictionaryWithObjectsAndKeys:</span>
                              <span class="p">[</span><span class="n">NSArray</span> <span class="nl">arrayWithArray:</span> <span class="n">sectionRecords</span><span class="p">],</span> <span class="s">@"Records"</span><span class="p">,</span>
                              <span class="n">label</span><span class="p">,</span> <span class="s">@"Name"</span><span class="p">,</span>
                              <span class="nb">nil</span><span class="p">];</span>
                <span class="p">[</span><span class="n">sections</span> <span class="nl">addObject:</span> <span class="n">section</span><span class="p">];</span>
                <span class="p">[</span><span class="n">sectionRecords</span> <span class="n">removeAllObjects</span><span class="p">];</span>
            <span class="p">}</span>
            <span class="n">sectionValue</span> <span class="o">=</span> <span class="n">recordValue</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="p">[</span><span class="n">sectionRecords</span> <span class="nl">addObject:</span> <span class="n">record</span><span class="p">];</span>
    <span class="p">}</span>
    <span class="k">if</span> <span class="p">(</span> <span class="p">[</span><span class="n">sectionRecords</span> <span class="n">count</span><span class="p">]</span> <span class="p">)</span> <span class="p">{</span>
        <span class="kt">id</span> <span class="n">lastRecord</span> <span class="o">=</span> <span class="p">[</span><span class="n">sectionRecords</span> <span class="nl">objectAtIndex:</span> <span class="mi">0</span><span class="p">];</span>
        <span class="kt">id</span> <span class="n">label</span> <span class="o">=</span> <span class="p">[</span><span class="n">lastRecord</span> <span class="nl">objectForKey:</span> <span class="n">labelKey</span><span class="p">];</span>
        <span class="kt">id</span> <span class="n">section</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSDictionary</span> <span class="nl">dictionaryWithObjectsAndKeys:</span>
                      <span class="p">[</span><span class="n">NSArray</span> <span class="nl">arrayWithArray:</span> <span class="n">sectionRecords</span><span class="p">],</span> <span class="s">@"Records"</span><span class="p">,</span>
                      <span class="n">label</span><span class="p">,</span> <span class="s">@"Name"</span><span class="p">,</span>
                      <span class="nb">nil</span><span class="p">];</span>
        <span class="p">[</span><span class="n">sections</span> <span class="nl">addObject:</span> <span class="n">section</span><span class="p">];</span>
        <span class="p">[</span><span class="n">sectionRecords</span> <span class="n">removeAllObjects</span><span class="p">];</span>
    <span class="p">}</span>
    
    <span class="k">return</span> <span class="p">[</span><span class="n">NSArray</span> <span class="nl">arrayWithArray:</span> <span class="n">sections</span><span class="p">];</span>
<span class="p">}</span>
</pre></div>
</td>
</tr></table></div>
</div>

<p>The redundancy makes this hard to maintain, but I don&#8217;t really want to split it off into a different function. That means passing all the parameters in to the second function.</p>

<p>But wait! Can we use blocks to clean this up? Yes, we can! We can define the code we want to execute in a block, then use the block as necessary within the function.</p>

<p>With blocks, the code looks like this:</p>

<div class="highlight-wrapper objc">
<div class="tools">
<div class="wrap">
<a href="#" class="about">?</a><div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<pre class="raw"><code lang="objc">
- (NSArray *)splitArray: (NSArray *)array
               valueKey: (NSString *)valueKey
               labelKey: (NSString *)labelKey;
{
    id sections = [NSMutableArray array];
    id sectionValue = nil;
    id sectionRecords = [NSMutableArray array];
    
    dispatch_block_t split = ^{
        if ( [sectionRecords count] ) {
            id lastRecord = [sectionRecords objectAtIndex: 0];
            id label = [lastRecord objectForKey: labelKey];
            id section = [NSDictionary dictionaryWithObjectsAndKeys:
                          [NSArray arrayWithArray: sectionRecords], @"Records",
                          label, @"Name",
                          nil];
            [sections addObject: section];
            [sectionRecords removeAllObjects];
        }
    };
    
    for (id record in array) {
        id recordValue = [record objectForKey: valueKey];
        if ( ![recordValue isEqual: sectionValue] ) {
            split();
            sectionValue = recordValue;
        }
        [sectionRecords addObject: record];
    }
    split();
    
    return [NSArray arrayWithArray: sections];
}
</code></pre>
<div class="highlighted"><table class="highlighttable"><tr>
<td class="linenos"><div class="linenodiv"><pre class="nl"> 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33</pre></div></td>
<td class="code">
<div class="highlight"><pre><span class="o">-</span> <span class="p">(</span><span class="n">NSArray</span> <span class="o">*</span><span class="p">)</span><span class="nl">splitArray:</span> <span class="p">(</span><span class="n">NSArray</span> <span class="o">*</span><span class="p">)</span><span class="n">array</span>
               <span class="nl">valueKey:</span> <span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="n">valueKey</span>
               <span class="nl">labelKey:</span> <span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="n">labelKey</span><span class="p">;</span>
<span class="p">{</span>
    <span class="kt">id</span> <span class="n">sections</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSMutableArray</span> <span class="n">array</span><span class="p">];</span>
    <span class="kt">id</span> <span class="n">sectionValue</span> <span class="o">=</span> <span class="nb">nil</span><span class="p">;</span>
    <span class="kt">id</span> <span class="n">sectionRecords</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSMutableArray</span> <span class="n">array</span><span class="p">];</span>
    
    <span class="n">dispatch_block_t</span> <span class="n">split</span> <span class="o">=</span> <span class="o">^</span><span class="p">{</span>
        <span class="k">if</span> <span class="p">(</span> <span class="p">[</span><span class="n">sectionRecords</span> <span class="n">count</span><span class="p">]</span> <span class="p">)</span> <span class="p">{</span>
            <span class="kt">id</span> <span class="n">lastRecord</span> <span class="o">=</span> <span class="p">[</span><span class="n">sectionRecords</span> <span class="nl">objectAtIndex:</span> <span class="mi">0</span><span class="p">];</span>
            <span class="kt">id</span> <span class="n">label</span> <span class="o">=</span> <span class="p">[</span><span class="n">lastRecord</span> <span class="nl">objectForKey:</span> <span class="n">labelKey</span><span class="p">];</span>
            <span class="kt">id</span> <span class="n">section</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSDictionary</span> <span class="nl">dictionaryWithObjectsAndKeys:</span>
                          <span class="p">[</span><span class="n">NSArray</span> <span class="nl">arrayWithArray:</span> <span class="n">sectionRecords</span><span class="p">],</span> <span class="s">@"Records"</span><span class="p">,</span>
                          <span class="n">label</span><span class="p">,</span> <span class="s">@"Name"</span><span class="p">,</span>
                          <span class="nb">nil</span><span class="p">];</span>
            <span class="p">[</span><span class="n">sections</span> <span class="nl">addObject:</span> <span class="n">section</span><span class="p">];</span>
            <span class="p">[</span><span class="n">sectionRecords</span> <span class="n">removeAllObjects</span><span class="p">];</span>
        <span class="p">}</span>
    <span class="p">};</span>
    
    <span class="k">for</span> <span class="p">(</span><span class="kt">id</span> <span class="n">record</span> <span class="k">in</span> <span class="n">array</span><span class="p">)</span> <span class="p">{</span>
        <span class="kt">id</span> <span class="n">recordValue</span> <span class="o">=</span> <span class="p">[</span><span class="n">record</span> <span class="nl">objectForKey:</span> <span class="n">valueKey</span><span class="p">];</span>
        <span class="k">if</span> <span class="p">(</span> <span class="o">!</span><span class="p">[</span><span class="n">recordValue</span> <span class="nl">isEqual:</span> <span class="n">sectionValue</span><span class="p">]</span> <span class="p">)</span> <span class="p">{</span>
            <span class="n">split</span><span class="p">();</span>
            <span class="n">sectionValue</span> <span class="o">=</span> <span class="n">recordValue</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="p">[</span><span class="n">sectionRecords</span> <span class="nl">addObject:</span> <span class="n">record</span><span class="p">];</span>
    <span class="p">}</span>
    <span class="n">split</span><span class="p">();</span>
    
    <span class="k">return</span> <span class="p">[</span><span class="n">NSArray</span> <span class="nl">arrayWithArray:</span> <span class="n">sections</span><span class="p">];</span>
<span class="p">}</span>
</pre></div>
</td>
</tr></table></div>
</div>

<p>Since the block by default has read-only access to any variable it wants as long as it&#8217;s in scope, there&#8217;s no need to pass parameters into the block.</p>

<p>As I said in the introduction, blocks are a lot more powerful than this. See Apple&#8217;s <a href="http://developer.apple.com/library/ios/#DOCUMENTATION/Cocoa/Conceptual/Blocks">Block Programming Topics</a> for more about that. However, they&#8217;re a great tool for small problems as well that you shouldn&#8217;t overlook.</p>
]]></content:encoded>
			<wfw:commentRss>http://tewha.net/2011/07/blocks-to-remove-redundancy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>foo() vs foo(void)</title>
		<link>http://tewha.net/2011/05/foo-vs-foovoid/</link>
		<comments>http://tewha.net/2011/05/foo-vs-foovoid/#comments</comments>
		<pubDate>Wed, 25 May 2011 22:57:04 +0000</pubDate>
		<dc:creator>Steven Fisher</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://tewha.net/?p=1163</guid>
		<description><![CDATA[Old content, but I just needed it now: The difference between foo() and foo(void) by Greg Miller. Hint: Objective-C doesn&#8217;t follow the C++ pattern. You probably want foo(void).]]></description>
			<content:encoded><![CDATA[<p>Old content, but I just needed it now: <a href="http://unixjunkie.blogspot.com/2006/03/difference-between-foo-and-foovoid.html">The difference between <code>foo()</code> and <code>foo(void)</code></a> by Greg Miller.</p>

<p>Hint: Objective-C doesn&#8217;t follow the C++ pattern. You probably want <code>foo(void)</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tewha.net/2011/05/foo-vs-foovoid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Assign, retain, copy pitfalls in Objective-C</title>
		<link>http://tewha.net/2010/06/assign-retain-copy-pitfalls-in-objective-c/</link>
		<comments>http://tewha.net/2010/06/assign-retain-copy-pitfalls-in-objective-c/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 15:11:47 +0000</pubDate>
		<dc:creator>Steven Fisher</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[iOS Development]]></category>
		<category><![CDATA[memory management]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[properties]]></category>

		<guid isPermaLink="false">http://tewha.net/2010/06/assign-retain-copy-pitfalls-in-objective-c/</guid>
		<description><![CDATA[Cocoa With Love (Matt Gallagher): Assign, retain, copy pitfalls in Objective-C.]]></description>
			<content:encoded><![CDATA[<p>Cocoa With Love (Matt Gallagher): <a href="http://feedproxy.google.com/~r/CocoaWithLove/~3/d2Zoneyryec/assign-retain-copy-pitfalls-in-obj-c.html">Assign, retain, copy pitfalls in Objective-C</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tewha.net/2010/06/assign-retain-copy-pitfalls-in-objective-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Objective-C 2.2 Features</title>
		<link>http://tewha.net/2010/06/objective-c-2-2-features/</link>
		<comments>http://tewha.net/2010/06/objective-c-2-2-features/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 20:28:11 +0000</pubDate>
		<dc:creator>Steven Fisher</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[Cocoa Touch]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[runtime]]></category>

		<guid isPermaLink="false">http://tewha.net/?p=1119</guid>
		<description><![CDATA[Martin Pilkington (Code Collector Pro) on Objective-C 2.2 features. He covers the code reduction features of the new runtime. These are coming to &#8220;modern&#8221; Apple runtimes, meaning 64-bit Mac and iPhone.]]></description>
			<content:encoded><![CDATA[<p>Martin Pilkington (Code Collector Pro) on <a href="http://www.mcubedsw.com/blog/index.php/site/comments/new_objective-c_features/">Objective-C 2.2 features</a>. He covers the code reduction features of the new runtime. These are coming to &#8220;modern&#8221; Apple runtimes, meaning 64-bit Mac and iPhone.</p>
]]></content:encoded>
			<wfw:commentRss>http://tewha.net/2010/06/objective-c-2-2-features/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Objective-C 2.0&#8242;s dot syntax</title>
		<link>http://tewha.net/2009/08/objective-c-2-0s-dot-syntax-2/</link>
		<comments>http://tewha.net/2009/08/objective-c-2-0s-dot-syntax-2/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 03:16:45 +0000</pubDate>
		<dc:creator>Steven Fisher</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[Objective-C 2.0]]></category>
		<category><![CDATA[properties]]></category>

		<guid isPermaLink="false">http://tewha.net/?p=1028</guid>
		<description><![CDATA[Chris Hanson on Objective-C 2.0&#8242;s dot syntax. When to use it, when to not use it, and what it&#8217;s really there for.]]></description>
			<content:encoded><![CDATA[<p>Chris Hanson on <a href="http://eschatologist.net/blog/?p=160">Objective-C 2.0&#8242;s dot syntax</a>. When to use it, when to not use it, and what it&#8217;s really there for.</p>
]]></content:encoded>
			<wfw:commentRss>http://tewha.net/2009/08/objective-c-2-0s-dot-syntax-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rules to avoid retain cycles</title>
		<link>http://tewha.net/2009/07/rules-to-avoid-retain-cycles/</link>
		<comments>http://tewha.net/2009/07/rules-to-avoid-retain-cycles/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 01:16:56 +0000</pubDate>
		<dc:creator>Steven Fisher</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[memory management]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[release retain]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://tewha.net/?p=967</guid>
		<description><![CDATA[Matt Gallagher: Rules to avoid retain cycles]]></description>
			<content:encoded><![CDATA[<p>Matt Gallagher: <a href="http://cocoawithlove.com/2009/07/rules-to-avoid-retain-cycles.html">Rules to avoid retain cycles</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tewha.net/2009/07/rules-to-avoid-retain-cycles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UIView manipulation made easier with a category</title>
		<link>http://tewha.net/2009/07/uiview-manipulation-made-easier-with-a-category/</link>
		<comments>http://tewha.net/2009/07/uiview-manipulation-made-easier-with-a-category/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 18:47:43 +0000</pubDate>
		<dc:creator>Steven Fisher</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[categories]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[UIView]]></category>

		<guid isPermaLink="false">http://tewha.net/?p=965</guid>
		<description><![CDATA[Michael Fey: UIView setup easier. I&#8217;ve done similar; very helpful.]]></description>
			<content:encoded><![CDATA[<p>Michael Fey: <a href="http://fruitstandsoftware.com/blog/2009/07/uiview-manipulation-made-easier-with-a-category/comment-page-1/#comment-4954">UIView setup easier</a>. I&#8217;ve done similar; very helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://tewha.net/2009/07/uiview-manipulation-made-easier-with-a-category/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Objective-J</title>
		<link>http://tewha.net/2008/12/objective-j/</link>
		<comments>http://tewha.net/2008/12/objective-j/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 06:04:50 +0000</pubDate>
		<dc:creator>Steven Fisher</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[Objective-J]]></category>

		<guid isPermaLink="false">http://tewha.net/?p=728</guid>
		<description><![CDATA[On Leaky Abstractions and Objective-J.]]></description>
			<content:encoded><![CDATA[<p><a href="http://cappuccino.org/discuss/2008/12/08/on-leaky-abstractions-and-objective-j/"> On Leaky Abstractions and Objective-J</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tewha.net/2008/12/objective-j/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WarpedVisions on Objective-C, square 1</title>
		<link>http://tewha.net/2008/08/warpedvisions-on-objective-c-square-1/</link>
		<comments>http://tewha.net/2008/08/warpedvisions-on-objective-c-square-1/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 23:57:28 +0000</pubDate>
		<dc:creator>Steven Fisher</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://tewha.net/?p=610</guid>
		<description><![CDATA[Bruce over on WarpedVisions writes on entering the world of Objective-C and Cocoa development. I&#8217;m barely past square one, but I found this an interesting title. Of course, what Bruce means is the whole Mac OS X development experience, but &#8230; <a href="http://tewha.net/2008/08/warpedvisions-on-objective-c-square-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Bruce over on WarpedVisions writes on <a href="http://warpedvisions.org/2008/08/24/objective-c-square-1/"> entering the world of Objective-C and Cocoa development</a>.</p>

<p>I&#8217;m barely past square one, but I found this an interesting title. Of course, what Bruce means is the whole Mac OS X development experience, but it&#8217;s interesting that he worded it in the title as learning Objective-C. It&#8217;s a simple, concise yet technically inaccurate way to label the knowledge. ((And I&#8217;m not intentionally picking on Bruce here. I have said it this way, and probably will again, and he <em>does</em> get it right in the text, as he noted below.))</p>

<p>Objective-C just might be the easiest part of Mac OS X development. The hard part is simply knowing what objects are available in Cocoa, where they are, and how to string them together. Basically, the typical framework problem. Don&#8217;t get me wrong, I&#8217;m still at the very bottom of the learning curve here!</p>

<p>Objective-C itself is very nice; it&#8217;s a truly minimal extension to C. I&#8217;m amazed at how it&#8217;s still a very complete object-oriented language yet so simple and small, with everything done the simple way.</p>

<p>When I first started with Cocoa, I was thinking of compiling notes together so I could write a short book/essay on &#8220;Learning Cocoa for C++ developers,&#8221; but as I&#8217;ve gone I&#8217;ve realized the first chapter should be &#8220;Forget everything you know about C++. You think need ___ to do ___? You do in C++, but in Objective-C just use the Cocoa class ___.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://tewha.net/2008/08/warpedvisions-on-objective-c-square-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: tewha.net @ 2012-05-22 22:56:26 -->
