Re: Recomputing non-standard Core Data attributes when child MOC is saved?

2013-06-18 Thread Dave Fernandes
The foolproof way to do it is to have the transient attributes recalculated each time they are accessed. In other words, they are simply getter methods. But if they are expensive to compute, this might not work well. If you are using bindings or KVO, you then have a class method + (NSSet*)keyPa

Re: NSOutlineView doesn't collapse item

2013-06-18 Thread Peng Gu
I've figured it out. Seems the item is collapsable only when the delegate method *- (BOOL)outlineView:(NSOutlineView *)outlineView shouldShowOutlineCellForItem:(id)item* returns YES for that item. Otherwise, you can only expand the item. Thanks, On Wed, Jun 19, 2013 at 11:20 AM, Jens Alfke wr

Re: NSOutlineView doesn't collapse item

2013-06-18 Thread Jens Alfke
On Jun 18, 2013, at 7:16 PM, Peng Gu wrote: >[[self.outlineView animator] collapseItem:item]; I’ve never tried using the animator proxy to do this; I don’t think it’s necessary (the expand/collapse will be animated anyway.) Have you tried calling the view directly? —Jens smime.p7s

NSOutlineView doesn't collapse item

2013-06-18 Thread Peng Gu
I have a NSOutlineView, and clicking on a row will expand/collapse the item if it's expandable. if ([self.outlineView isItemExpanded:item]) { NSLog("Will collapse item : %@", item); [[self.outlineView animator] collapseItem:item]; } else { [[self.outlineView ani

Re: Recomputing non-standard Core Data attributes when child MOC is saved?

2013-06-18 Thread Rick Mann
On Jun 18, 2013, at 19:07 , Laurent Daudelin wrote: > Just a wild guess but what about awakeFromInsert? Well, I think that only gets called when you first create the object. In my case, objects already exist. -- Rick ___ Cocoa-dev mailing list

Re: Recomputing non-standard Core Data attributes when child MOC is saved?

2013-06-18 Thread Laurent Daudelin
Just a wild guess but what about awakeFromInsert? -Laurent. -- Laurent Daudelin AIM/iChat/Skype:LaurentDaudelin http://www.nemesys-soft.com/ Logiciels Nemesys Software laur...@nemesys-soft.com On Jun 18, 2013, at 21:21, Rick

Recomputing non-standard Core Data attributes when child MOC is saved?

2013-06-18 Thread Rick Mann
I have some entities instantiated in the main MOC. In a child MOC, I update some non-standard attributes that write out a shadow attribute (CGPoint to NSString). Then I save the child MOC. But the existing entities in the main MOC don't currently update their non-standard attribute. This is cur

Re: NSFetchedResultsController getting insert update on delete?

2013-06-18 Thread Rick Mann
More information: the MOC is getting only a delete. Something about the NSFetchedResultsController is causing it to sent an insert after the delete. On Jun 17, 2013, at 22:40 , Rick Mann wrote: > I'm deleting a core data entity when my user swipes across the > UITableViewCell. I've been doing

Re: core data lightweight migration woes

2013-06-18 Thread Martin Hewitson
OK, I tried commenting out the setMetadataForStoreAtURL: part, but still it fails. Maybe I'm going to have to use one of my precious DTS tickets for this. Martin On Jun 18, 2013, at 08:32 PM, Martin Hewitson wrote: > Yes, alas, alas I have tried all of that and checked all settings, to no >

Re: core data lightweight migration woes

2013-06-18 Thread Martin Hewitson
Yes, alas, alas I have tried all of that and checked all settings, to no avail. If I select the old model version, everything works fine (at least old documents can be opened). Thanks, Martin On 18 Jun 2013, at 19:00, davel...@mac.com wrote: > > Are you 100% certain you set the "Versioned Co

Re: core data lightweight migration woes

2013-06-18 Thread davelist
Are you 100% certain you set the "Versioned Core Data Model" "current" setting to the latest model in the inspector pane on the right side of Xcode. Have you tried doing a clean and rebuilding? I think I once had an issue where it didn't seem to start using the new model until I did a clean bui

Re: core data lightweight migration woes

2013-06-18 Thread Martin Hewitson
On Jun 18, 2013, at 05:26 PM, Dave Fernandes wrote: > Looks pretty standard, but I would try commenting out the call to > setMetadataForStoreAtURL: I'll try this and report back. > Besides that, I don't know what to suggest. I know, it's a peculiar case. I've performed light migration many,

Re: core data lightweight migration woes

2013-06-18 Thread Dave Fernandes
Looks pretty standard, but I would try commenting out the call to setMetadataForStoreAtURL: Besides that, I don't know what to suggest. On 2013-06-18, at 11:14 AM, Martin Hewitson wrote: > The code is below. Anything look suspicious there? > > Thanks, > > Martin > > - (BOOL)configurePersiste

Re: view gets drawRect called when scrolling into elastic area

2013-06-18 Thread Kyle Sluder
On Tue, Jun 18, 2013, at 06:12 AM, Steve Mills wrote: > On Jun 17, 2013, at 14:07:09, Kyle Sluder wrote: > > > Elastic scrolling is pretty rough around the edges. There's no API for > > drawing into that area, yet apparently it's willing to invalidate all > > your other content. > > How could th

Re: core data lightweight migration woes

2013-06-18 Thread Martin Hewitson
The code is below. Anything look suspicious there? Thanks, Martin - (BOOL)configurePersistentStoreCoordinatorForURL:(NSURL*)url ofType:(NSString*)fileType modelConfiguration:(NSString*)configuration

Re: core data lightweight migration woes

2013-06-18 Thread Dave Fernandes
What does your configurePersistentStoreCoordinatorForURL:ofType:modelConfiguration:storeOptions:error: do? On 2013-06-18, at 5:09 AM, Martin Hewitson wrote: > Another question on this problem: does anyone know if > NSStoreModelVersionIdentifiers is used in looking for a source model to infer

Re: view gets drawRect called when scrolling into elastic area

2013-06-18 Thread Steve Mills
On Jun 17, 2013, at 14:07:09, Kyle Sluder wrote: > Elastic scrolling is pretty rough around the edges. There's no API for > drawing into that area, yet apparently it's willing to invalidate all > your other content. How could they have missed that? > I guess you could set a breakpoint on -setNe

Re: core data lightweight migration woes

2013-06-18 Thread Martin Hewitson
Another question on this problem: does anyone know if NSStoreModelVersionIdentifiers is used in looking for a source model to infer a mapping model from? To recap: 1) Loading an existing document with the version 11 model works 2) Adding a new version (12) with a single new boolean property on

Re: core data lightweight migration woes

2013-06-18 Thread Martin Hewitson
>> >> >> I just had another thought I have another core data model in the app. I >> wonder if the NSPersistentDocument infrastructure is picking up the wrong >> model? As I'm looking through the project, I realise I don't know how the >> document knows which core data model to use OK,