- (void)dealloc {
[calculations release];
+ [super dealloc];
}
- (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"];
}