0
這是好的,從NSDocument加載NSWindowController,並保持對NSArrayController的引用? 我需要這個數組控制器的實例來保存數據。NSDocument有伊娃到NSArrayController
- (void)makeWindowControllers
{
ImageWindowController *controller = [[[ImageWindowController alloc] init] autorelease];
[self addWindowController:controller];
myArrayController = controller.bindingsController;
}
//保存
- (NSData*)dataOfType:(NSString *)typeName error:(NSError **)outError
{
return [NSKeyedArchiver archivedDataWithRootObject:myArrayController.arrangedObjects];
}