• 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
Collection of Cocoa & objc questions from a "newbie"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Collection of Cocoa & objc questions from a "newbie"


  • Subject: Collection of Cocoa & objc questions from a "newbie"
  • From: tyler <email@hidden>
  • Date: Mon, 16 Jul 2001 16:21:21 -0700

Hi All,
So I've been working through the Learning Cocoa book and have generated the following questions regarding the Dot View example application in Ch 8.


Several curious things.


1) Objective C: it appears that methods do not really need to be declared in the .h file of objective C files in order for them to get compiled and called by other classes.

1a) the inherited methods awakeFromNib, initWithFrame and so on seem to get called for the DotView custom view even though I chose not to type them into the DotView.h file.

1b) the custom methods I defined that controls are using as action methods seem to be callable without declaring them in the DotView.h file as well.

1c) the DotView.m file compiles just fine with methods that are NOT declared in the .h file.


How is this possible? I'm used to c/c++/pascal/etc that require a declaration to even compile.



2) If I set breakpoints in the DotView custom View I see that several methods are called twice (awakeFromNib and initWithFrame in particular). It appears the the "self" value in the debugger has changed so I'm guessing that one call is for the "proxy" object created due to the nib (not that I really understand what that means, just read it somewhere), and one is the real object that I defined and that the proxy instantiates (???).




3) If I set a breakpoint in the (void)dealloc method for the DotView custom view, it is never called (close window, quit app, never called).

Does this mean that code in a dealloc method may never be called in general and shouldn't be counted on getting called?




Thanks in advance for any light you can shed on any of this.
peace,
tyler


  • Follow-Ups:
    • Re: Collection of Cocoa & objc questions from a "newbie"
      • From: Chris Gehlker <email@hidden>
    • Re: Collection of Cocoa & objc questions from a "newbie"
      • From: "David P. Henderson" <email@hidden>
References: 
 >Re: Learning Cocoa (OT!: Small Language Rant) (From: Chris Gehlker <email@hidden>)

  • Prev by Date: Re: Learning Cocoa (OT!: Small Language Rant)
  • Next by Date: NSPathUtilities bug?
  • Previous by thread: Re: Learning Cocoa (OT!: Small Language Rant)
  • Next by thread: Re: Collection of Cocoa & objc questions from a "newbie"
  • Index(es):
    • Date
    • Thread