• 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
DotView.m
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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/


  • Follow-Ups:
    • Re: DotView.m
      • From: "Erik M. Buck" <email@hidden>
    • Re: DotView.m
      • From: Graeme Phillipson <email@hidden>
  • Prev by Date: Re: Catching key events
  • Next by Date: Re: DotView.m
  • Previous by thread: Re: Catching key events
  • Next by thread: Re: DotView.m
  • Index(es):
    • Date
    • Thread