Crash during resize & overriding drawRect on NSMatrix
Crash during resize & overriding drawRect on NSMatrix
- Subject: Crash during resize & overriding drawRect on NSMatrix
- From: "A. Jetha" <email@hidden>
- Date: Sun, 26 Aug 2001 00:37:52 -0400
Gang,
I've run into a real weird problem. We have a subclass of
NSMatrix (ObjC) that, when resized, crashes the app. If that
very same object is put into a simple test app, the following
warning is displayed:
Aug 25 23:54:20 MatrixTest[1221] WARN ONCE: Not live resizing
[MCMatrix] <MCMatrix: 0xf89d20> because: might do custom drawing.
After some investigation, we found out that the problem was
caused by the following code in the subclass:
- (void)drawRect:(NSRect)rect {
// NSLog(@"drawRect called ...");
[super drawRect:rect];
}
The code was there just to figure something out. Instead of
deleting the code, we just commented out the NSLog line.
Commenting out the whole method solves the problem.
/*
- (void)drawRect:(NSRect)rect {
// NSLog(@"drawRect called ...");
[super drawRect:rect];
}
*/
What puzzles me, is how is Apple able to detect that we are
overriding a method and why does this produce a warning in one
app and crashes another?
Really puzzled ....
./aj