• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Crash during resize & overriding drawRect on NSMatrix
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Goofy NSDrawer behavior
  • Next by Date: Finding keyboard state in Cocoa
  • Previous by thread: Re: Saving a series of BitmapReps as Quicktime
  • Next by thread: Finding keyboard state in Cocoa
  • Index(es):
    • Date
    • Thread