Create and save a NSPersistentDocument from scratch

2009-11-11 Thread Eric Morand
Hi guys ! I'm trying to implement a welcome screen like the ones found in Garage Band or Xcode : the user will be showed a window with a Create new document button that, when clicked, show a save panel. Once saved, the application should open the document. I'm facing a problem when I try to

Re: Create and save a NSPersistentDocument from scratch

2009-11-11 Thread Eric Morand
11 nov. 2009 à 19:01, Quincey Morris a écrit : On Nov 11, 2009, at 04:34, Eric Morand wrote: - (void)savePanelDidEnd:(NSSavePanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { if (returnCode == NSOKButton) { NSPersistentDocument * newDoc

Re: Create and save a NSPersistentDocument from scratch

2009-11-11 Thread Eric Morand
Thanks Quincey, Your code pointed me in the right direction : I needed to create a persistent store (of type NSSQLiteStoreStype) like in your example and add it to the newly created document context. I also replaced the file type SQLite with the correct file type defined in my plist

Re: Core-Data : how to merge two contexts ?

2009-11-07 Thread Eric Morand
The NSManagedObjectContext is your scratchpad. If you want something inside it fetch it or create it. If you change something, the change will be promoted. Hi atze, Actually, the change will be promoted only when they are committed to the store, and that implies a save on the disk. Or

Re: Core-Data : how to merge two contexts ?

2009-11-07 Thread Eric Morand
But why don’t you want to save? If you just want your objects in memory, why use CoreData at all? Hi atze, I'll probably end up using the merge... method available but that makes me feel bad to save a document automatically when the user should be the only one responsible for this. For

Binding problem : getter not called when property change

2009-11-02 Thread Eric Morand
Hi guys, I have a NSImageView instance that I want to display a default image when the user delete its content - namely, I want it to display a question mark instead of displaying an empty space. The image view Value property is bound to the icon property of my controller, which is of

Re: Binding problem : getter not called when property change

2009-11-02 Thread Eric Morand
Thanks a lot for the clarification, you made my day. I'll try to subclass NSImageView to achieve what I need. Kind regards, Eric. Le 2 nov. 2009 à 14:42, Uli Kusterer a écrit : On 02.11.2009, at 13:49, Eric Morand wrote: The setIcon: method is successfully called when I delete

Re: Master addChildObject: not called when adding child from an array controller !

2009-09-28 Thread Eric Morand
keys, meaning that you can't override +keyPathsForValuesAffectingValueForKey: and return a key path that goes through an NSController. --Kyle Sluder On 9/27/09, Eric Morand eric.mor...@me.com wrote: Hi guys, I'm trying to implement a rather simple functionality in my app. I have a Core Data

Master addChildObject: not called when adding child from an array controller !

2009-09-27 Thread Eric Morand
not called ? Is the array controller inserting the invoice line using primitive methods ? Is this the normal behavior ? Thanks for your help, Eric Morand. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests