version 1.1, universal binary, new xcode
[LeanCalc.git] / Sources / MyDocument.m
index 6791d37..76f6e6c 100644 (file)
@@ -29,6 +29,7 @@
 
 - (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"];
        
 }