<?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>Tristan O'Tierney &#187; cocoa</title>
	<atom:link href="http://www.otierney.net/articles/tag/cocoa/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.otierney.net</link>
	<description>Mac Geek</description>
	<lastBuildDate>Wed, 09 Sep 2009 17:23:35 +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>Missing Objective-C 2.0 Feature(s)</title>
		<link>http://www.otierney.net/articles/2008/05/13/missing-objective-c-20-features/</link>
		<comments>http://www.otierney.net/articles/2008/05/13/missing-objective-c-20-features/#comments</comments>
		<pubDate>Wed, 14 May 2008 06:21:32 +0000</pubDate>
		<dc:creator>tristan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[objc]]></category>
		<category><![CDATA[objc2]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.otierney.net/?p=336</guid>
		<description><![CDATA[This post was inspired by a recent twitter that I thought I might elaborate on a bit more. One of the nice new features of Objective-C 2.0 is dot-syntax for read/write proprerties. For example: Person *person = [[Person alloc] init]; person.mobileNumber = @"1-555-123-1234"; This is uber nifty, and can save you a load of time [...]]]></description>
			<content:encoded><![CDATA[<p>This post was inspired by a recent <a href="http://twitter.com/omnivector/statuses/810821171">twitter</a> that I thought I might elaborate on a bit more.  One of the nice new features of Objective-C 2.0 is dot-syntax for read/write proprerties.  For example:
<br/></p>

<pre class="code">
Person *person = [[Person alloc] init];
person.mobileNumber = @"1-555-123-1234";
</pre>

<p>This is uber nifty, and can save you a load of time and redundant code.  However it&#8217;s often the case that I want to hide access to certain private member variables, but still expose accessors/mutators to attributes on those private variables.  Let&#8217;s say mobileNumber is actually an accessor/mutator on a sub-object, let&#8217;s call it <em>PhoneBook</em>.  Under the hood, this is implemented like so:
<br/></p>

<pre class="code">
@interface Person {
    PhoneBook *phoneBook;
}

@property (nonatomic, rertain) NSString *mobileNumber;
@end

@implementation Person
- (void)setMobileNumber:(NSString *)number {
    phoneBook.mobileNumber = number;
}

- (NSString *)mobileNumber {
    return phoneBook.mobileNumber;
}
@end
</pre>

<p>This seems far from ideal, when really I just want to pass through the implementation of this accessor/mutator to one of my instance variables.  A more clean and hypothetical implementation could look like this:
<br/></p>

<pre class="code">
@interface Person {
    PhoneBook *phoneBook;
}

@property (nonatomic, retain) NSString *mobileNumber;
@end

@implementation Person
@synthesize mobileNumber=phoneNumber.mobileNumber;
@end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.otierney.net/articles/2008/05/13/missing-objective-c-20-features/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ObjectiveYouTube 0.1 Released</title>
		<link>http://www.otierney.net/articles/2008/03/18/objectiveyoutube-01-released/</link>
		<comments>http://www.otierney.net/articles/2008/03/18/objectiveyoutube-01-released/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 05:24:25 +0000</pubDate>
		<dc:creator>tristan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[objectiveyoutube]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://www.otierney.net/articles/2008/03/18/objectiveyoutube-01-released/</guid>
		<description><![CDATA[So I had time tonight to package what I&#8217;ve got working, and would like to get some more eyeballs looking at it. Please check it out! Download available at Google Code.]]></description>
			<content:encoded><![CDATA[<p>So I had time tonight to package what I&#8217;ve got working, and would like to get some more eyeballs looking at it.
Please check it out!  Download available at <a href="http://code.google.com/p/objectiveyoutube/">Google Code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.otierney.net/articles/2008/03/18/objectiveyoutube-01-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ObjectiveYouTube mostly done</title>
		<link>http://www.otierney.net/articles/2008/03/18/objectiveyoutube-mostly-done/</link>
		<comments>http://www.otierney.net/articles/2008/03/18/objectiveyoutube-mostly-done/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 18:49:12 +0000</pubDate>
		<dc:creator>tristan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[objectiveyoutube]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://www.otierney.net/articles/2008/03/18/objectiveyoutube-mostly-done/</guid>
		<description><![CDATA[So after going through all the trouble of writing a generic multipart form generator, and screen scraping youtube, etc I&#8217;ve completely rewritten it to use the new spiffy YouTube write apis that came out literally a day after I completed all that prior work. Oh well, the good news is this library will be shielded [...]]]></description>
			<content:encoded><![CDATA[<p>So after going through all the trouble of writing a generic multipart form generator, and screen scraping youtube, etc I&#8217;ve completely rewritten it to use the new spiffy <a href="http://code.google.com/apis/youtube/developers_guide_protocol.html">YouTube write apis</a> that came out literally a day after I completed all that prior work.  Oh well, the good news is this library will be shielded from things like YouTube updating their website since I no longer have to screen scrape.  So the downsides are the lib will only handle authentication and uploading, mostly because those are all I need right now.  I may let the community fix that problem if anyone else needs that functionality.  Look out for a post in the next couple days while I finish up the readme/licensing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.otierney.net/articles/2008/03/18/objectiveyoutube-mostly-done/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NSURL, I loath thee</title>
		<link>http://www.otierney.net/articles/2008/01/25/nsurl-i-loath-thee/</link>
		<comments>http://www.otierney.net/articles/2008/01/25/nsurl-i-loath-thee/#comments</comments>
		<pubDate>Sat, 26 Jan 2008 00:29:12 +0000</pubDate>
		<dc:creator>tristan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[flickrbooth]]></category>
		<category><![CDATA[nsurl]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://www.otierney.net/articles/2008/01/25/nsurl-i-loath-thee/</guid>
		<description><![CDATA[So I know I shouldn&#8217;t complain too much, coming from Safari not too long ago, but I felt I must rant about something. In my quest to bring YouTube support to FlickrBooth (is that app name even going to make sense after such a feature?) I&#8217;ve come to the sad realization that NSURL sucks. It [...]]]></description>
			<content:encoded><![CDATA[<p>So I know I shouldn&#8217;t complain too much, coming from Safari not too long ago, but I felt I must rant about something.  In my quest to bring YouTube support to FlickrBooth (is that app name even going to make sense after such a feature?) I&#8217;ve come to the sad realization that NSURL sucks.  It doesn&#8217;t have a feature-rich enough API, making you have to break down to CF functions.  It makes you use important to forget string functions like [NSString stringByAddingPercentEscapes] which have fun ways of creating bugs you didn&#8217;t anticipate.  It lacks any sort of GET/POST automatic query generation.  It has no helper functions for cookies, which are this entirely separate-but-shared entity.  I feel like Apple ported (or did they write it from scratch?) it on top of WebKit for Panther and basically let it wither without any substantial feature additions since.   I suppose on one hand you could argue that it means the API will remain stable, making it easier for future development but Apple does seem to have a hit and run policy of releasing a new awesome library, then basically never touching it again except for bug fixes.  WebKit in particular I would not account such harsh words to.  The API adapts quite rapidly, despite many additional functions winding up on the &#8220;Unofficial but available&#8221; headers.  But this is by virtue of it&#8217;s OpenSource facing policy.  AppKit/Foundation doesn&#8217;t exactly have the same liberal policy.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.otierney.net/articles/2008/01/25/nsurl-i-loath-thee/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>C Me See Objective-C</title>
		<link>http://www.otierney.net/articles/2007/04/26/c-me-see-objective-c/</link>
		<comments>http://www.otierney.net/articles/2007/04/26/c-me-see-objective-c/#comments</comments>
		<pubDate>Thu, 26 Apr 2007 20:21:51 +0000</pubDate>
		<dc:creator>tristan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macdev]]></category>
		<category><![CDATA[objectivec]]></category>

		<guid isPermaLink="false">http://www.otierney.net/articles/2007/04/26/c-me-see-objective-c/</guid>
		<description><![CDATA[I know Wil Shipley talked about this awhile back (hell if I can find the post though) but it bothers me often enough to bring the discussion back up &#8212; Why don&#8217;t we have more Cocoa libraries for C based stuff in Mac OS X? Everytime some unfortunate functionality requires me to link in some [...]]]></description>
			<content:encoded><![CDATA[<p>I know Wil Shipley talked about this awhile back (hell if I can find the post though) but it bothers me often enough to bring the discussion back up &#8212; Why don&#8217;t we have more Cocoa libraries for C based stuff in Mac OS X?  Everytime some unfortunate functionality requires me to link in some archaic Carbon or C based Mac OS X library I cringe.  My first attempt is to check <a href="http://www.cocoadev.com">CocoaDev</a> or <a href="http://www.cocoabuilder.com">CocoaBuilder</a> praying that someone&#8217;s been annoyed enough by the lack of a Cocoa wrapper for their favorite library to go write one, and maybe the license is something I can use freely.  Sometimes I get lucky, sometimes I come up short.  What does bother me is I feel like sourceforge, freshmeat, etc just aren&#8217;t quite the places to go for this sort of code and I think other mac devs feel the same way.  We need something like macosxforge where Cocoa devs can go, without going on a google hunt, to find native cocoa libraries that take the headache out of dealing with this relic of Mac OS 9 style coding.  Anyone with me?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.otierney.net/articles/2007/04/26/c-me-see-objective-c/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Objective-C Rocks Your Socks</title>
		<link>http://www.otierney.net/articles/2007/01/20/objective-c-rocks-your-socks/</link>
		<comments>http://www.otierney.net/articles/2007/01/20/objective-c-rocks-your-socks/#comments</comments>
		<pubDate>Sat, 20 Jan 2007 20:20:49 +0000</pubDate>
		<dc:creator>tristan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[macdev]]></category>
		<category><![CDATA[objectivec]]></category>

		<guid isPermaLink="false">http://www.otierney.net/articles/2007/01/20/objective-c-rocks-your-socks/</guid>
		<description><![CDATA[People who don&#8217;t know a thing about Objective-C are always asking me why I&#8217;d want to learn a special language &#8220;just for Mac programming&#8221; or why I like it more than most other programming languages in general. I think this is a great code snippet that made me stop and say you could NOT do [...]]]></description>
			<content:encoded><![CDATA[<p>People who don&#8217;t know a thing about Objective-C are always asking me why I&#8217;d want to learn a special language &#8220;just for Mac programming&#8221; or why I like it more than most other programming languages in general.  I think this is a great code snippet that made me stop and say you could NOT do this so elegantly in C++ or many other languages.</p>

<pre>
NSArray *participants = [archive valueForKey:@"participants"];
NSEnumerator *en = [participants objectEnumerator];
User *user = nil;

while (user = [en nextObject]) {                    
    // do stuff with the user
}
</pre>

<p>So what&#8217;s fascinating about this simple block of code? Let me explain.  Lets say <code>archive</code> is a regular <code>NSDictionary</code> object, and <code>participants</code> is an OPTIONAL key/value in this dictionary which could contain an array of <code>Users</code>.  How does that affect the rest of our code?  Well that means the <code>NSArray</code> <code>participants</code> will be nil.  So what happens when you call <code>objectEnumerator</code> on a nil object? An error? Nope! calling a message (any message) on an nil object returns nil.  So that means en, our enumerator, becomes nil.  Now when we get to our while loop calling <code>nextObject</code> on en will also return nil.  Thus <strong>the loop terminates gracefully</strong> without any error checking code, an no sig-faults from calling our &#8220;nil&#8221; objects.  I&#8217;ve just written code that not only performs it&#8217;s task but gracefully degrades even under optional conditions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.otierney.net/articles/2007/01/20/objective-c-rocks-your-socks/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>
