- (void)dealloc {
[calculations release];
+ [super dealloc];
}
}
[arrayController setSelectionIndex:[calculations count] - 1];
+
}
+
- (IBAction)commit:(id)sender {
if (![[sender stringValue] length]) return;
- (void)addItem {
- [arrayController add:self];
+ Calculation *newcalc = [[[Calculation alloc] init] autorelease];
+ [arrayController addObject:newcalc];
int count = [calculations count];
- id last = [calculations objectAtIndex:count - 1];
id secondtolast = [calculations objectAtIndex:count - 2];
- [secondtolast setValue:last forKey:@"next"];
+ [secondtolast setValue:newcalc forKey:@"next"];
}
}
-- (void)windowControllerDidLoadNib:(NSWindowController *) aController {
+- (void)windowControllerDidLoadNib:(NSWindowController *)aController {
+ NSWindow *win = [aController window];
+ [win performSelector:@selector(makeFirstResponder:) withObject:expressionField afterDelay:0.0];
[super windowControllerDidLoadNib:aController];
}