fixed shared CPDocumentController instantiation and added its test

This commit is contained in:
ggsato
2012-05-24 23:12:07 +09:00
parent 1efc2e3c15
commit 7da9877c5f
14 changed files with 3427 additions and 7 deletions
@@ -0,0 +1,38 @@
/*
* AppController.j
* CappDoc
*
* Created by You on May 24, 2012.
* Copyright 2012, Your Company All rights reserved.
*/
@import <Foundation/CPObject.j>
@import "Document.j"
@import "DocumentController.j"
@implementation AppController : CPObject
{
CPDocumentController subclassedCPDocumentController;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
// This is called when the application is done loading.
var cpAlert = [CPAlert alertWithMessageText:@"Is this the shared instance? " + ([CPDocumentController sharedDocumentController] == subclassedCPDocumentController) defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:nil];
[cpAlert beginSheetModalForWindow:[[CPApplication sharedApplication] mainWindow]];
}
- (void)applicationWillFinishLaunching:(CPNotification)aNotification
{
// instantiate a subclass of DocumentController
subclassedCPDocumentController = [[DocumentController alloc] init];
}
- (void)awakeFromCib
{
// This is called when the cib is done loading.
// You can implement this method on any object instantiated from a Cib.
// It's a useful hook for setting up current UI values, and other things.
}
@end