From a94619cf7a9e296303d1149eb5a5146da1461999 Mon Sep 17 00:00:00 2001 From: Jeena Paradies Date: Tue, 20 Sep 2011 00:05:09 +0200 Subject: [PATCH] refactoring --- English.lproj/MyDocument.xib | 890 ----------------------------------- MyDocument.h | 27 -- MyDocument.m | 116 ----- 3 files changed, 1033 deletions(-) delete mode 100644 English.lproj/MyDocument.xib delete mode 100644 MyDocument.h delete mode 100644 MyDocument.m diff --git a/English.lproj/MyDocument.xib b/English.lproj/MyDocument.xib deleted file mode 100644 index fd79165..0000000 --- a/English.lproj/MyDocument.xib +++ /dev/null @@ -1,890 +0,0 @@ - - - - 1050 - 10D573 - 762 - 1038.29 - 460.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 762 - - - YES - - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - YES - - YES - - - YES - - - - YES - - MyDocument - - - FirstResponder - - - 7 - 2 - {{133, 535}, {299, 113}} - 1886913536 - New Tweet - NSWindow - View - {1.79769e+308, 1.79769e+308} - {94, 86} - - - 256 - - YES - - - 274 - {{0, 22}, {299, 91}} - - YES - - -1809711615 - 272629760 - - - LucidaGrande - 13 - 1044 - - - YES - - 6 - System - textBackgroundColor - - 3 - MQA - - - - 6 - System - textColor - - 3 - MAA - - - - - - - 268 - {{257, 2}, {38, 17}} - - YES - - 68288064 - 71304192 - 140 - - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - controlTextColor - - - - - - {299, 113} - - - {{0, 0}, {1440, 878}} - {94, 108} - {1.79769e+308, 1.79769e+308} - newTweet - NO - 22 - - - NSApplication - - - - - YES - - - window - - - - 18 - - - - sendTweet: - - - - 100031 - - - - textField - - - - 100034 - - - - delegate - - - - 100035 - - - - counter - - - - 100038 - - - - - YES - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - 5 - - - YES - - - - Window - - - 6 - - - YES - - - - - - - -3 - - - Application - - - 100028 - - - YES - - - - - - 100029 - - - - - 100036 - - - YES - - - - - - 100037 - - - - - - - YES - - YES - -3.IBPluginDependency - 100028.IBPluginDependency - 100029.IBPluginDependency - 100036.IBPluginDependency - 100037.IBPluginDependency - 5.IBEditorWindowLastContentRect - 5.IBPluginDependency - 5.IBWindowTemplateEditedContentRect - 5.ImportedFromIB2 - 5.editorWindowContentRectSynchronizationRect - 5.windowTemplate.hasMinSize - 5.windowTemplate.minSize - 6.IBPluginDependency - 6.ImportedFromIB2 - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{127, 736}, {299, 113}} - com.apple.InterfaceBuilder.CocoaPlugin - {{127, 736}, {299, 113}} - - {{201, 387}, {507, 413}} - - {94, 86} - com.apple.InterfaceBuilder.CocoaPlugin - - - - - YES - - - YES - - - - - YES - - - YES - - - - 100038 - - - - YES - - MyDocument - NSDocument - - sendTweet: - NSControl - - - YES - - YES - counter - textField - - - YES - NSTextField - NSTextField - - - - IBProjectSource - MyDocument.h - - - - - YES - - NSActionCell - NSCell - - IBFrameworkSource - AppKit.framework/Headers/NSActionCell.h - - - - NSApplication - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSApplication.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSApplicationScripting.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSColorPanel.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSHelpManager.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSPageLayout.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSUserInterfaceItemSearching.h - - - - NSCell - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSCell.h - - - - NSControl - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSControl.h - - - - NSDocument - NSObject - - YES - - YES - printDocument: - revertDocumentToSaved: - runPageLayout: - saveDocument: - saveDocumentAs: - saveDocumentTo: - - - YES - id - id - id - id - id - id - - - - IBFrameworkSource - AppKit.framework/Headers/NSDocument.h - - - - NSDocument - - IBFrameworkSource - AppKit.framework/Headers/NSDocumentScripting.h - - - - NSFormatter - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFormatter.h - - - - NSMenu - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenu.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSAccessibility.h - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDictionaryController.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDragging.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontManager.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontPanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSKeyValueBinding.h - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSNibLoading.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSOutlineView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSPasteboard.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSSavePanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSTableView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbarItem.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSView.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObjectScripting.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPortCoder.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptObjectSpecifiers.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptWhoseTests.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLDownload.h - - - - NSObject - - IBFrameworkSource - Print.framework/Headers/PDEPluginInterface.h - - - - NSObject - - IBFrameworkSource - Sparkle.framework/Headers/SUAppcast.h - - - - NSObject - - IBFrameworkSource - Sparkle.framework/Headers/SUUpdater.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebDownload.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebEditingDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebFrameLoadDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebJavaPlugIn.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPlugin.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPluginContainer.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPolicyDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebResourceLoadDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebScriptObject.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebUIDelegate.h - - - - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSInterfaceStyle.h - - - - NSResponder - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSResponder.h - - - - NSTextField - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSTextField.h - - - - NSTextFieldCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSTextFieldCell.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSClipView.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItem.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSRulerView.h - - - - NSView - NSResponder - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSDrawer.h - - - - NSWindow - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSWindow.h - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSWindowScripting.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - ../Twittia 2.xcodeproj - 3 - - diff --git a/MyDocument.h b/MyDocument.h deleted file mode 100644 index c10ff30..0000000 --- a/MyDocument.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// MyDocument.h -// Twittia 2 -// -// Created by Jeena on 16.04.10. -// Licence: BSD (see attached LICENCE.txt file). -// - - -#import - - -@interface MyDocument : NSDocument -{ - IBOutlet NSTextField *textField; - IBOutlet NSTextField *counter; - NSString *inReplyTostatusId; -} - -@property (nonatomic, retain) IBOutlet NSTextField *textField; -@property (nonatomic, retain) IBOutlet NSTextField *counter; - -- (IBAction)sendTweet:(NSControl *)control; -- (void)inReplyTo:(NSString *)userName statusId:(NSString *)statusId; -- (void)withString:(NSString *)aString; - -@end diff --git a/MyDocument.m b/MyDocument.m deleted file mode 100644 index a172f59..0000000 --- a/MyDocument.m +++ /dev/null @@ -1,116 +0,0 @@ -// -// MyDocument.m -// Twittia 2 -// -// Created by Jeena on 16.04.10. -// Licence: BSD (see attached LICENCE.txt file). -// - -#import "MyDocument.h" -#import "Constants.h" -#import "TweetModel.h" - -@implementation MyDocument - -@synthesize textField, counter; - - -- (id)init -{ - self = [super init]; - if (self) { - - // Add your subclass-specific initialization here. - // If an error occurs here, send a [self release] message and return nil. - inReplyTostatusId = @""; - } - return self; -} - -- (NSString *)windowNibName -{ - // Override returning the nib file name of the document - // If you need to use a subclass of NSWindowController or if your document supports multiple NSWindowControllers, you should remove this method and override -makeWindowControllers instead. - return @"MyDocument"; -} - -- (NSString *)displayName { - return @"New Tweet"; -} - -- (void)windowControllerDidLoadNib:(NSWindowController *) aController -{ - [super windowControllerDidLoadNib:aController]; - // Add any code here that needs to be executed once the windowController has loaded the document's window. -} - -- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError -{ - // Insert code here to write your document to data of the specified type. If the given outError != NULL, ensure that you set *outError when returning nil. - - // You can also choose to override -fileWrapperOfType:error:, -writeToURL:ofType:error:, or -writeToURL:ofType:forSaveOperation:originalContentsURL:error: instead. - - // For applications targeted for Panther or earlier systems, you should use the deprecated API -dataRepresentationOfType:. In this case you can also choose to override -fileWrapperRepresentationOfType: or -writeToFile:ofType: instead. - - if ( outError != NULL ) { - *outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:NULL]; - } - return nil; -} - -- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError -{ - // Insert code here to read your document from the given data of the specified type. If the given outError != NULL, ensure that you set *outError when returning NO. - - // You can also choose to override -readFromFileWrapper:ofType:error: or -readFromURL:ofType:error: instead. - - // For applications targeted for Panther or earlier systems, you should use the deprecated API -loadDataRepresentation:ofType. In this case you can also choose to override -readFromFile:ofType: or -loadFileWrapperRepresentation:ofType: instead. - - if ( outError != NULL ) { - *outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:NULL]; - } - return YES; -} - -- (void)inReplyTo:(NSString *)userName statusId:(NSString *)statusId { - [textField setStringValue:[NSString stringWithFormat:@"@%@ ", userName]]; - NSRange range = {[[textField stringValue] length] , 0}; - [[textField currentEditor] setSelectedRange:range]; - [inReplyTostatusId release]; - inReplyTostatusId = statusId; - [inReplyTostatusId retain]; -} - -- (void)withString:(NSString *)aString { - [textField setStringValue:aString]; - NSRange range = {[[textField stringValue] length] , 0}; - [[textField currentEditor] setSelectedRange:range]; -} - --(void)controlTextDidChange:(NSNotification *)aNotification { - NSInteger c = 140 - [[textField stringValue] length]; - [counter setIntValue:c]; - if(c < 0) { - [counter setTextColor:[NSColor redColor]]; - } else { - [counter setTextColor:[NSColor controlTextColor]]; - } -} - - -#pragma mark Keyboard delegate methods - -- (IBAction)sendTweet:(NSControl *)control { - if ([[control stringValue] length] <= TWEET_MAX_LENGTH) { - TweetModel *tweet = [[[TweetModel alloc] init] autorelease]; - tweet.text = [control stringValue]; - tweet.inReplyTostatusId = inReplyTostatusId; - [[NSNotificationCenter defaultCenter] postNotificationName:@"sendTweet" object:tweet]; - [self close]; - } else { - NSBeep(); - } - -} - -@end