Author: torehalset
Date: Tue Nov 7 12:59:12 2006
New Revision: 472256
URL: http://svn.apache.org/viewvc?view=rev&rev=472256
Log:
undo stuff not yet implemented in CocoaCayenne framework
Modified:
incubator/cayenne/sandbox/CocoaCayenne/CAYClient/AppController.m
incubator/cayenne/sandbox/CocoaCayenne/CAYClient/English.lproj/MainMenu.nib/keyedobjects.nib
Modified: incubator/cayenne/sandbox/CocoaCayenne/CAYClient/AppController.m
URL:
http://svn.apache.org/viewvc/incubator/cayenne/sandbox/CocoaCayenne/CAYClient/AppController.m?view=diff&rev=472256&r1=472255&r2=472256
==============================================================================
--- incubator/cayenne/sandbox/CocoaCayenne/CAYClient/AppController.m (original)
+++ incubator/cayenne/sandbox/CocoaCayenne/CAYClient/AppController.m Tue Nov 7
12:59:12 2006
@@ -62,6 +62,12 @@
[self setObjectContext:ctxt];
[ctxt release];
+ // set the undo manager if you want undo support. see also
windowWillReturnUndoManager that make
+ // the undoManager accessible to the application
+ NSUndoManager *um = [[NSUndoManager alloc] init];
+ [ctxt setUndoManager:um];
+ [um release];
+
// set the object context of the custom array controller. needed to
// be able to add artists
[artistsController setObjectContext:[self objectContext]];
@@ -119,6 +125,12 @@
-(CAYObjectContext *)objectContext
{
return objectContext;
+}
+
+// trick to use NSUndoManager in a non-document based application
+//
http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdFAQ.html#//apple_ref/doc/uid/TP40001802-244036
+- (NSUndoManager *) windowWillReturnUndoManager:(NSWindow *)sender {
+ return [[self objectContext] undoManager];
}
-(void)dealloc
Modified:
incubator/cayenne/sandbox/CocoaCayenne/CAYClient/English.lproj/MainMenu.nib/keyedobjects.nib
URL:
http://svn.apache.org/viewvc/incubator/cayenne/sandbox/CocoaCayenne/CAYClient/English.lproj/MainMenu.nib/keyedobjects.nib?view=diff&rev=472256&r1=472255&r2=472256
==============================================================================
Binary files - no diff available.