<?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 for Blog @ Tim Isted</title>
	<atom:link href="http://www.timisted.net/blog/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.timisted.net/blog</link>
	<description>Cocoa Programming and Other Things</description>
	<lastBuildDate>Fri, 12 Feb 2010 09:51:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Drag and Drop Rearranging in Table Views with Core Data by Tobidobi</title>
		<link>http://www.timisted.net/blog/archive/core-data-drag-drop/comment-page-1/#comment-913</link>
		<dc:creator>Tobidobi</dc:creator>
		<pubDate>Fri, 12 Feb 2010 09:51:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.timisted.net/blog/?p=22#comment-913</guid>
		<description>Great article, Tim. Thank you!</description>
		<content:encoded><![CDATA[<p>Great article, Tim. Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Drag and Drop Rearranging in Table Views with Core Data by admin</title>
		<link>http://www.timisted.net/blog/archive/core-data-drag-drop/comment-page-1/#comment-773</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 29 Jan 2010 14:35:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.timisted.net/blog/?p=22#comment-773</guid>
		<description>Thanks, Glen; I now remember that I found the bug shortly after posting the code and completely forgot to update it.

Quite a lot going on recently, but normal service should be resumed again soon :)</description>
		<content:encoded><![CDATA[<p>Thanks, Glen; I now remember that I found the bug shortly after posting the code and completely forgot to update it.</p>
<p>Quite a lot going on recently, but normal service should be resumed again soon <img src='http://www.timisted.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Drag and Drop Rearranging in Table Views with Core Data by Glen Harding</title>
		<link>http://www.timisted.net/blog/archive/core-data-drag-drop/comment-page-1/#comment-767</link>
		<dc:creator>Glen Harding</dc:creator>
		<pubDate>Thu, 28 Jan 2010 21:27:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.timisted.net/blog/?p=22#comment-767</guid>
		<description>Thanks for this, it saved me a huge amount of time. But I had a small problem when moving items at the beginning of the table backwards. For example: an item at the start of the list with viewPosition=0, and moving it back to position 3 - where my table has 5 items in it. 

This would cause the viewPosition sequence to skip a number - 0,1,2,4,5. This problem in turn actually stops you from dragging an item to the end of the table. In my case with 5 items, dragging the item to the end of the list in the table would only ever put it 2nd last.

The way I got around this was to make a simple change in tableView:acceptDrop

change 

tempRow = row;
to
tempRow = row - 1;

Hope this helps anybody else experiencing this little problem. 

But many thanks again for this post - can&#039;t tell you how much work it saved</description>
		<content:encoded><![CDATA[<p>Thanks for this, it saved me a huge amount of time. But I had a small problem when moving items at the beginning of the table backwards. For example: an item at the start of the list with viewPosition=0, and moving it back to position 3 &#8211; where my table has 5 items in it. </p>
<p>This would cause the viewPosition sequence to skip a number &#8211; 0,1,2,4,5. This problem in turn actually stops you from dragging an item to the end of the table. In my case with 5 items, dragging the item to the end of the list in the table would only ever put it 2nd last.</p>
<p>The way I got around this was to make a simple change in tableView:acceptDrop</p>
<p>change </p>
<p>tempRow = row;<br />
to<br />
tempRow = row &#8211; 1;</p>
<p>Hope this helps anybody else experiencing this little problem. </p>
<p>But many thanks again for this post &#8211; can&#8217;t tell you how much work it saved</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Multiple Windows with Core Data by Eric</title>
		<link>http://www.timisted.net/blog/archive/multiple-windows-with-core-data/comment-page-1/#comment-602</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Thu, 14 Jan 2010 08:34:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.timisted.net/blog/?p=3#comment-602</guid>
		<description>Gold......

I had just ventured beyond using single nib, single window controller core data apps to something a bit more complex and was stumped.  Your tutorial smashed it!

Thanks for the work!</description>
		<content:encoded><![CDATA[<p>Gold&#8230;&#8230;</p>
<p>I had just ventured beyond using single nib, single window controller core data apps to something a bit more complex and was stumped.  Your tutorial smashed it!</p>
<p>Thanks for the work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Core Data Migration and Versioning by Core Data Migration : 61355</title>
		<link>http://www.timisted.net/blog/archive/core-data-migration/comment-page-1/#comment-136</link>
		<dc:creator>Core Data Migration : 61355</dc:creator>
		<pubDate>Mon, 21 Dec 2009 07:47:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.timisted.net/blog/?p=181#comment-136</guid>
		<description>[...] I&#8217;m working on the migration for one of my Core Data document based application, i&#8217;ve created a mapping model in XCode and am using the &#8220;NSMigratePersistentStoresAutomaticallyOption&#8221; property by overriding the &#8220;configurePersistentStoreCoordinatorForURL:&#8230;&#8221; method. as described in this awesome link: http://www.timisted.net/blog/archive/core-data-migration/ [...]</description>
		<content:encoded><![CDATA[<p>[...] I&#8217;m working on the migration for one of my Core Data document based application, i&#8217;ve created a mapping model in XCode and am using the &#8220;NSMigratePersistentStoresAutomaticallyOption&#8221; property by overriding the &#8220;configurePersistentStoreCoordinatorForURL:&#8230;&#8221; method. as described in this awesome link: <a href="http://www.timisted.net/blog/archive/core-data-migration/" rel="nofollow">http://www.timisted.net/blog/archive/core-data-migration/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Drag and Drop Rearranging in Table Views with Core Data by Ellie</title>
		<link>http://www.timisted.net/blog/archive/core-data-drag-drop/comment-page-1/#comment-30</link>
		<dc:creator>Ellie</dc:creator>
		<pubDate>Mon, 07 Dec 2009 05:54:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.timisted.net/blog/?p=22#comment-30</guid>
		<description>Thanks for the clear post! This was very helpful.</description>
		<content:encoded><![CDATA[<p>Thanks for the clear post! This was very helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Multiple Windows with Core Data by Allan Daly</title>
		<link>http://www.timisted.net/blog/archive/multiple-windows-with-core-data/comment-page-1/#comment-11</link>
		<dc:creator>Allan Daly</dc:creator>
		<pubDate>Thu, 19 Nov 2009 05:21:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.timisted.net/blog/?p=3#comment-11</guid>
		<description>Very useful article. I&#039;ve been playing with exactly this issue for a couple days now and arrived at some but not all of the same conclusions you did. Your approach makes a lot of sense and I&#039;m adopting it completely. Thank you for taking the time to put together this document. You saved me hours. -Allan</description>
		<content:encoded><![CDATA[<p>Very useful article. I&#8217;ve been playing with exactly this issue for a couple days now and arrived at some but not all of the same conclusions you did. Your approach makes a lot of sense and I&#8217;m adopting it completely. Thank you for taking the time to put together this document. You saved me hours. -Allan</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Custom Table Cells, Bindings and Core Data by Tim Costa</title>
		<link>http://www.timisted.net/blog/archive/custom-cells-and-core-data/comment-page-1/#comment-23</link>
		<dc:creator>Tim Costa</dc:creator>
		<pubDate>Tue, 27 Oct 2009 17:33:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.timisted.net/blog/?p=15#comment-23</guid>
		<description>Sorry... in step 2 I put some angled brackets which got edited out by the board software.

It should read -(void)set_YourClassName_Dictionary.  Re-add the setter that you removed in Tim&#039;s original tutorial.</description>
		<content:encoded><![CDATA[<p>Sorry&#8230; in step 2 I put some angled brackets which got edited out by the board software.</p>
<p>It should read -(void)set_YourClassName_Dictionary.  Re-add the setter that you removed in Tim&#8217;s original tutorial.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Custom Table Cells, Bindings and Core Data by Tim Costa</title>
		<link>http://www.timisted.net/blog/archive/custom-cells-and-core-data/comment-page-1/#comment-22</link>
		<dc:creator>Tim Costa</dc:creator>
		<pubDate>Tue, 27 Oct 2009 17:30:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.timisted.net/blog/?p=15#comment-22</guid>
		<description>Tim, thanks for your great tutorial!  Using it I was able to add basic editing to my custom cell.  I thought I would share with everyone else.  It doesn&#039;t move the editor to the proper location visually, but shows how to get the guts of editing working.  Basically, it takes advantage of an NSFormatter subclass, and the fact that we are using dictionaries.

1. I subclassed NSTextFieldCell, rather than NSCell.  (I&#039;m not sure yet how to do this with just NSCell.  In my case I have a name, and some read only metadata about the object I am displaying, so this works fine for me.)

2. Add the following to your NSManagedObject subclass (PersonObject in your example):

-(void)setDictionary
{
	[self setValuesForKeysWithDictionary:aDictionary];
}

3. Subclass NSFormatter with the following methods (these are the minimum required to subclass NSFormatter, according to the documentation)

- (BOOL)getObjectValue:(id *)anObject forString:(NSString *)string errorDescription:(NSString **)error
{
	if (anObject){
		*anObject = [NSDictionary dictionaryWithObject:string forKey:@&quot;name&quot;];
		return YES;
	}
	return NO; // This probably shouldn&#039;t happen...Could be a bindings issue if it does?
}
- (NSString *)stringForObjectValue:(id)anObject
{
    if (![anObject isKindOfClass:[NSDictionary class]])
        return nil;
    return [anObject valueForKey:@&quot;name&quot;]; // This will propagate back to your NSManagedObject subclass, since we created setDictionary.
}
- (NSAttributedString*)attributedStringForObjectValue:(id)anObject withDefaultAttributes:(NSDictionary *)attrs
{
	if (![anObject isKindOfClass:[NSDictionary class]])
        return nil;
    NSAttributedString * anAttributedString = [[NSAttributedString alloc]initWithString: [anObject valueForKey:@&quot;name&quot;]];

	return anAttributedString;
}

4. Add the following to your NSTextFieldCell&#039;s awakeFromNib:
	MyFormatter * aMyFormatter = [[[MyFormatter alloc]init]autorelease];
	[self setFormatter:aMyFormatter];

That should be it, if I didn&#039;t leave out any steps...  I hope this helps someone, and if you spot anything that can be improved in my code, please post a followup!
-Tim</description>
		<content:encoded><![CDATA[<p>Tim, thanks for your great tutorial!  Using it I was able to add basic editing to my custom cell.  I thought I would share with everyone else.  It doesn&#8217;t move the editor to the proper location visually, but shows how to get the guts of editing working.  Basically, it takes advantage of an NSFormatter subclass, and the fact that we are using dictionaries.</p>
<p>1. I subclassed NSTextFieldCell, rather than NSCell.  (I&#8217;m not sure yet how to do this with just NSCell.  In my case I have a name, and some read only metadata about the object I am displaying, so this works fine for me.)</p>
<p>2. Add the following to your NSManagedObject subclass (PersonObject in your example):</p>
<p>-(void)setDictionary<br />
{<br />
	[self setValuesForKeysWithDictionary:aDictionary];<br />
}</p>
<p>3. Subclass NSFormatter with the following methods (these are the minimum required to subclass NSFormatter, according to the documentation)</p>
<p>- (BOOL)getObjectValue:(id *)anObject forString:(NSString *)string errorDescription:(NSString **)error<br />
{<br />
	if (anObject){<br />
		*anObject = [NSDictionary dictionaryWithObject:string forKey:@"name"];<br />
		return YES;<br />
	}<br />
	return NO; // This probably shouldn&#8217;t happen&#8230;Could be a bindings issue if it does?<br />
}<br />
- (NSString *)stringForObjectValue:(id)anObject<br />
{<br />
    if (![anObject isKindOfClass:[NSDictionary class]])<br />
        return nil;<br />
    return [anObject valueForKey:@"name"]; // This will propagate back to your NSManagedObject subclass, since we created setDictionary.<br />
}<br />
- (NSAttributedString*)attributedStringForObjectValue:(id)anObject withDefaultAttributes:(NSDictionary *)attrs<br />
{<br />
	if (![anObject isKindOfClass:[NSDictionary class]])<br />
        return nil;<br />
    NSAttributedString * anAttributedString = [[NSAttributedString alloc]initWithString: [anObject valueForKey:@"name"]];</p>
<p>	return anAttributedString;<br />
}</p>
<p>4. Add the following to your NSTextFieldCell&#8217;s awakeFromNib:<br />
	MyFormatter * aMyFormatter = [[[MyFormatter alloc]init]autorelease];<br />
	[self setFormatter:aMyFormatter];</p>
<p>That should be it, if I didn&#8217;t leave out any steps&#8230;  I hope this helps someone, and if you spot anything that can be improved in my code, please post a followup!<br />
-Tim</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Contact Details by Tim Isted</title>
		<link>http://www.timisted.net/blog/contact-details/comment-page-1/#comment-33</link>
		<dc:creator>Tim Isted</dc:creator>
		<pubDate>Thu, 08 Oct 2009 07:20:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.timisted.net/blog/?page_id=72#comment-33</guid>
		<description>Hi Diethard, I&#039;m not sure how much information there will be on maintaining order, but you might find the post here:
http://www.timisted.net/blog/archive/core-data-drag-drop/
useful, even though it was written some time ago, and from a drag and drop desktop point of view.

There are various resources on the web that offer other solutions, such as:
http://www.fatcatsoftware.com/blog/2008/per-object-ordered-relationships-using-core-data

Thanks,
Tim</description>
		<content:encoded><![CDATA[<p>Hi Diethard, I&#8217;m not sure how much information there will be on maintaining order, but you might find the post here:<br />
<a href="http://www.timisted.net/blog/archive/core-data-drag-drop/" rel="nofollow">http://www.timisted.net/blog/archive/core-data-drag-drop/</a><br />
useful, even though it was written some time ago, and from a drag and drop desktop point of view.</p>
<p>There are various resources on the web that offer other solutions, such as:<br />
<a href="http://www.fatcatsoftware.com/blog/2008/per-object-ordered-relationships-using-core-data" rel="nofollow">http://www.fatcatsoftware.com/blog/2008/per-object-ordered-relationships-using-core-data</a></p>
<p>Thanks,<br />
Tim</p>
]]></content:encoded>
	</item>
</channel>
</rss>
