[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
strange crasher that puzzles me
From: |
Sebastian Reitenbach |
Subject: |
strange crasher that puzzles me |
Date: |
Tue, 31 Mar 2009 15:32:30 +0200 |
User-agent: |
KMail/1.9.9 |
Hi,
I guess its just a beginner error that I made, but I'm trying to figure out
what the problem is, but I fail since some days.
I already created a smaller test application, just to demonstrate the problem,
but there it just works, which puzzles me even more.
What I want to do is to create a reverse polish calculator, where numbers can
be entered, and then after clicking on submit, they are intended to be added
to a NSMutableArray, misused as a stack:
- (void) submitNumber: (id)sender
{
NSLog(@"submitNumber!!!!");
if (numberStack == nil) {
NSLog(@"numberStack was nil, creating array");
numberStack = [NSMutableArray array];
} else {
NSLog(@"numberStack was not nil");
NSLog(@"numberStack was: %@", numberStack);
}
// [numberStack addObject:[actualNumber stringValue]];
NSLog(@"numberStack: %@, actualNumber: %@", numberStack, [actualNumber
stringValue]);
// [self updateActualStack];
// [self clearPressed:self];
}
The log statement and the commented out lines are from my testing.
So in my application, when I first enter some number, and press submit, this
works, but I don't get the actual number added to the stack of the
NSMutableDirectory (also when I remove the comments in front of that line ;)
Then I enter a second number, and then on a second click on the submit button,
my app crashes, and I have no idea why.
Therefore I thought I created a test app, which shows just this problem, but
there it just works as I expect it to work. Most of the things are just
cut 'n pasted from the original app into my test app, just have some shorter
variable names there.
The original app can be found here:
https://www.l00-bugdead-prods.de/CacheTool.tar.gz
and the test app I created can be found here:
https://www.l00-bugdead-prods.de/TestRPN.tar.gz
Both are developed using Gorm/ProjectCenter. After starting the CacheTool,
open the RPN Calculator from the Tools menu enter some number, press submit,
enter some more numbers, and press submit -> crash.
The TestRPN app just starts with a small interface, a button to enter 1 and a
submit button, there it "just works" TM.
Any idea why I get the crasher in the CacheTool, but not in the TestRPN app?
That puzzles me since two days, and I have no idea how to overcome the problem
or where to look for it?
greetings
Sebastian