<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: How to sort an NSDictionary on iPhone</title>
	<atom:link href="http://t-machine.org/index.php/2009/10/25/how-to-sort-an-nsdictionary-on-iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://t-machine.org/index.php/2009/10/25/how-to-sort-an-nsdictionary-on-iphone/</link>
	<description>Internet Gaming, Computer Games, Technology, MMO, and Web 2.0</description>
	<lastBuildDate>Sun, 05 Sep 2010 20:30:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: adam</title>
		<link>http://t-machine.org/index.php/2009/10/25/how-to-sort-an-nsdictionary-on-iphone/comment-page-1/#comment-5912</link>
		<dc:creator>adam</dc:creator>
		<pubDate>Mon, 10 May 2010 19:39:40 +0000</pubDate>
		<guid isPermaLink="false">http://t-machine.org/?p=697#comment-5912</guid>
		<description>Do you need them? If not,  delete them</description>
		<content:encoded><![CDATA[<p>Do you need them? If not,  delete them</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leon Bogaert</title>
		<link>http://t-machine.org/index.php/2009/10/25/how-to-sort-an-nsdictionary-on-iphone/comment-page-1/#comment-5897</link>
		<dc:creator>Leon Bogaert</dc:creator>
		<pubDate>Mon, 10 May 2010 13:35:46 +0000</pubDate>
		<guid isPermaLink="false">http://t-machine.org/?p=697#comment-5897</guid>
		<description>Thanks!

Only now these two implementations are missing:
-(NSUInteger)indexOfKey:(id)anObject;
-(id)keyAtIndex:(NSUInteger)index;</description>
		<content:encoded><![CDATA[<p>Thanks!</p>
<p>Only now these two implementations are missing:<br />
-(NSUInteger)indexOfKey:(id)anObject;<br />
-(id)keyAtIndex:(NSUInteger)index;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adam</title>
		<link>http://t-machine.org/index.php/2009/10/25/how-to-sort-an-nsdictionary-on-iphone/comment-page-1/#comment-5889</link>
		<dc:creator>adam</dc:creator>
		<pubDate>Mon, 10 May 2010 06:00:07 +0000</pubDate>
		<guid isPermaLink="false">http://t-machine.org/?p=697#comment-5889</guid>
		<description>@Leon

Something like this:

#import &lt;Foundation/Foundation.h&gt;

@interface SortedDictionary : NSObject
{
	NSMutableArray *underlyingArray;
	NSMutableDictionary *underlyingDictionary;
}
@property(nonatomic, retain) NSMutableArray *underlyingArray;
@property(nonatomic, retain) NSMutableDictionary *underlyingDictionary;

#pragma mark NSDictionary methods
-(id)objectForKey:(id)aKey;
-(id)valueForKey:(NSString *)key;
-(NSUInteger)count;
-(NSArray *)allKeys;
-(NSArray *)allValues;

#pragma mark NSMutableDictionary methods
-(void)setObject:(id)anObject forKey:(id)aKey;
-(void)setValue:(id)value forKey:(NSString *)key;
-(void)removeObjectForKey:(id)aKey;
-(void)removeAllObjects;

#pragma mark Customized NSArray methods
-(NSUInteger)indexOfKey:(id)anObject;
-(id)keyAtIndex:(NSUInteger)index;

#pragma mark custom methods
-(void)addObject:(id)anObject forKey:(id)aKey;
-(void)addValue:(id)value forKey:(NSString *)key;

@end</description>
		<content:encoded><![CDATA[<p>@Leon</p>
<p>Something like this:</p>
<p>#import <foundation /Foundation.h></p>
<p>@interface SortedDictionary : NSObject<br />
{<br />
	NSMutableArray *underlyingArray;<br />
	NSMutableDictionary *underlyingDictionary;<br />
}<br />
@property(nonatomic, retain) NSMutableArray *underlyingArray;<br />
@property(nonatomic, retain) NSMutableDictionary *underlyingDictionary;</p>
<p>#pragma mark NSDictionary methods<br />
-(id)objectForKey:(id)aKey;<br />
-(id)valueForKey:(NSString *)key;<br />
-(NSUInteger)count;<br />
-(NSArray *)allKeys;<br />
-(NSArray *)allValues;</p>
<p>#pragma mark NSMutableDictionary methods<br />
-(void)setObject:(id)anObject forKey:(id)aKey;<br />
-(void)setValue:(id)value forKey:(NSString *)key;<br />
-(void)removeObjectForKey:(id)aKey;<br />
-(void)removeAllObjects;</p>
<p>#pragma mark Customized NSArray methods<br />
-(NSUInteger)indexOfKey:(id)anObject;<br />
-(id)keyAtIndex:(NSUInteger)index;</p>
<p>#pragma mark custom methods<br />
-(void)addObject:(id)anObject forKey:(id)aKey;<br />
-(void)addValue:(id)value forKey:(NSString *)key;</p>
<p>@end</foundation></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leon Bogaert</title>
		<link>http://t-machine.org/index.php/2009/10/25/how-to-sort-an-nsdictionary-on-iphone/comment-page-1/#comment-5883</link>
		<dc:creator>Leon Bogaert</dc:creator>
		<pubDate>Sun, 09 May 2010 23:50:18 +0000</pubDate>
		<guid isPermaLink="false">http://t-machine.org/?p=697#comment-5883</guid>
		<description>Hi!

Could you also share to .h file?

Thanks!

Leon</description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>Could you also share to .h file?</p>
<p>Thanks!</p>
<p>Leon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brad</title>
		<link>http://t-machine.org/index.php/2009/10/25/how-to-sort-an-nsdictionary-on-iphone/comment-page-1/#comment-3267</link>
		<dc:creator>Brad</dc:creator>
		<pubDate>Thu, 29 Oct 2009 22:13:21 +0000</pubDate>
		<guid isPermaLink="false">http://t-machine.org/?p=697#comment-3267</guid>
		<description>Thank you for the warning that XCode&#039;s library versioning support is problematic.

As far as whether a person should carry around a one page license for their personal libraries, especially if they work for more than one company or do consulting?  The answer is:  YES.  Yes, they should, because that&#039;s the sensible way of avoiding having to write MySortedDictionary or MyBufferClassWhichActuallyWorks every single time that the problem comes up again.

I&#039;ll just be the old, grumpy programmer complaining about kids these days who get so spoiled by having standard libraries that do everything for them that the forget what it was like to do real programming, and go back to keeping the neighbor kids off of my lawn.</description>
		<content:encoded><![CDATA[<p>Thank you for the warning that XCode&#8217;s library versioning support is problematic.</p>
<p>As far as whether a person should carry around a one page license for their personal libraries, especially if they work for more than one company or do consulting?  The answer is:  YES.  Yes, they should, because that&#8217;s the sensible way of avoiding having to write MySortedDictionary or MyBufferClassWhichActuallyWorks every single time that the problem comes up again.</p>
<p>I&#8217;ll just be the old, grumpy programmer complaining about kids these days who get so spoiled by having standard libraries that do everything for them that the forget what it was like to do real programming, and go back to keeping the neighbor kids off of my lawn.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adam</title>
		<link>http://t-machine.org/index.php/2009/10/25/how-to-sort-an-nsdictionary-on-iphone/comment-page-1/#comment-3245</link>
		<dc:creator>adam</dc:creator>
		<pubDate>Wed, 28 Oct 2009 10:32:05 +0000</pubDate>
		<guid isPermaLink="false">http://t-machine.org/?p=697#comment-3245</guid>
		<description>Nothing stops you from copy/pasting this class from project to project. Just ... you end up with hundreds of duplicate copies.

OR ... you have to write (and maintain) an entire library just to contain this, so that you only have one copy of hte source.

But ... now what happens when you update the version? Xcode-for-iPhone is extremely weak at managing library versioning (it works OK on OS X, but a lot of the versioning stuff seems to be disabled for iPhone). You have to regression test against every project you ever made.

And what about working on different projects for different companies? Are you going to write a one-page license and give it to each client you worked for? (obviously, you don&#039;t *have* to - but not doing so tends to revert to the &quot;many copies lying around all running different versions&quot;).

Basically: for any fundamental classes, if they&#039;re not inside a standard library, it is a massive pain to deal with them in the long term. This is one of the massive wins that Java brought, and has since been adopted by most new languages. It doesn&#039;t seem that big a deal at first, but once you&#039;re maintaining apps on a regular basis, suddenly it IS a big deal

(compare this to e.g. PHP, which is stuck with non-standard standard libraries - a horrific mess - where most people end up using the 3rd party libs anyway. Development is slower and more error-prone whenever you do anything in PHP that works with a library, because it&#039;s so easy to not be aware that App X is using a version of Lib Y that you&#039;ve never even seen before).</description>
		<content:encoded><![CDATA[<p>Nothing stops you from copy/pasting this class from project to project. Just &#8230; you end up with hundreds of duplicate copies.</p>
<p>OR &#8230; you have to write (and maintain) an entire library just to contain this, so that you only have one copy of hte source.</p>
<p>But &#8230; now what happens when you update the version? Xcode-for-iPhone is extremely weak at managing library versioning (it works OK on OS X, but a lot of the versioning stuff seems to be disabled for iPhone). You have to regression test against every project you ever made.</p>
<p>And what about working on different projects for different companies? Are you going to write a one-page license and give it to each client you worked for? (obviously, you don&#8217;t *have* to &#8211; but not doing so tends to revert to the &#8220;many copies lying around all running different versions&#8221;).</p>
<p>Basically: for any fundamental classes, if they&#8217;re not inside a standard library, it is a massive pain to deal with them in the long term. This is one of the massive wins that Java brought, and has since been adopted by most new languages. It doesn&#8217;t seem that big a deal at first, but once you&#8217;re maintaining apps on a regular basis, suddenly it IS a big deal</p>
<p>(compare this to e.g. PHP, which is stuck with non-standard standard libraries &#8211; a horrific mess &#8211; where most people end up using the 3rd party libs anyway. Development is slower and more error-prone whenever you do anything in PHP that works with a library, because it&#8217;s so easy to not be aware that App X is using a version of Lib Y that you&#8217;ve never even seen before).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brad</title>
		<link>http://t-machine.org/index.php/2009/10/25/how-to-sort-an-nsdictionary-on-iphone/comment-page-1/#comment-3243</link>
		<dc:creator>Brad</dc:creator>
		<pubDate>Tue, 27 Oct 2009 23:18:17 +0000</pubDate>
		<guid isPermaLink="false">http://t-machine.org/?p=697#comment-3243</guid>
		<description>&quot;It’s that easy … and yet, because Apple didn’t do it, you have to re-write this class every time you start a new project. Sigh.&quot;

I&#039;m sorry, I&#039;m probably reacting to what&#039;s intended as a dramatic statement, but what part of XCode development makes the reuse of a developer&#039;s personal code library difficult?

It seems to be a bit like complaining that Extensions are useless because the added methods aren&#039;t automatically visible to all applications.</description>
		<content:encoded><![CDATA[<p>&#8220;It’s that easy … and yet, because Apple didn’t do it, you have to re-write this class every time you start a new project. Sigh.&#8221;</p>
<p>I&#8217;m sorry, I&#8217;m probably reacting to what&#8217;s intended as a dramatic statement, but what part of XCode development makes the reuse of a developer&#8217;s personal code library difficult?</p>
<p>It seems to be a bit like complaining that Extensions are useless because the added methods aren&#8217;t automatically visible to all applications.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
