X-Git-Url: http://www.entropy.ch/git/LeanCalc.git/blobdiff_plain/b06626b06874ceb58dec25471f51583488f5ea93..f5fbaceee4c5c117ef600df1362fa90333ed8bc9:/Sources/MyDocument.m diff --git a/Sources/MyDocument.m b/Sources/MyDocument.m index 6791d37..76f6e6c 100644 --- a/Sources/MyDocument.m +++ b/Sources/MyDocument.m @@ -29,6 +29,7 @@ - (void)dealloc { [calculations release]; + [super dealloc]; } @@ -66,11 +67,11 @@ - (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"]; }