-
Notifications
You must be signed in to change notification settings - Fork 1
/
TableView.m
71 lines (43 loc) · 1.7 KB
/
TableView.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//
// TableView.m
// SkeinFox
//
// Created by Jordan on 10/19/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import "TableView.h"
#import "Controller.h"
@implementation TableView
@synthesize myController;
// make return and tab only end editing, and not cause other cells to edit
//- (BOOL) textShouldEndEditing:(NSNotification *)notification {
// //NSLog(@"tableView textShouldEndEditing");
// return YES;
//}
//- (void)textDidChange:(NSNotification *)aNotification {
// //NSLog(@"tableView textDidChange!");
//
//}
- (void) textDidEndEditing:(NSNotification *)notification
{
//NSLog(@"tableview textDidEndEditing!!!!!!");
NSString *newGitBranchName = [[[notification object] textStorage] string];
NSDictionary *userInfo = [notification userInfo];
int textMovement = [[userInfo valueForKey:@"NSTextMovement"] intValue];
if (textMovement == NSReturnTextMovement
|| textMovement == NSTabTextMovement
|| textMovement == NSBacktabTextMovement) {
NSMutableDictionary *newInfo;
newInfo = [NSMutableDictionary dictionaryWithDictionary: userInfo];
[newInfo setObject: [NSNumber numberWithInt: NSIllegalTextMovement]
forKey: @"NSTextMovement"];
notification =
[NSNotification notificationWithName: [notification name]
object: [notification object]
userInfo: newInfo];
}
[super textDidEndEditing: notification];
[[self window] makeFirstResponder:self];
[myController didRenameGitBranch:newGitBranchName];
} // textDidEndEditing
@end