DotView.m
DotView.m
- Subject: DotView.m
- From: Craig Bakalian <email@hidden>
- Date: Wed, 07 Nov 2001 05:12:20 -0500
Hi,
I am new to Cocoa. I am on page 136 to 137 of O'Reilly's Learning
Cocoa. My question is about the event order of DotView.m, specifically the
instance methode:
-(void)mouseUp: (NSEvent*)event
{
NSPoint = blah,blah...
center = blah,blah...
[self setNeedsDisplay: YES]
}
Is the [self setNeedsDisplay:YES] message firing the -(void)drawRect:
(NSRect)rect? I know this is not good MVC but couldn't DotView.m replace
[self setNeedsDisplay:YES] with [self drawRect: (NSRect)frame?
And, on page 136 I quote, "2. Implement dealloc as shown. There's nothing
unusual here:"
-(void)dealloc{
[color release]
[super dealloc]
}
I know Learning Cocoa is not a master's thesis, but the part about "nothing
unusual here" is a tutorial that abandons the reader. My question is when
the DotView.m is loaded into memory, it eventually has to be unloaded, this
is the purpose of the above, but what is firing this method? Please tell me
what is not unusual.
Craig Bakalian
http://home.earthlink.net/~testconstructor/