home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.next.programmer
- Path: sparky!uunet!utcsri!torn!nott!bnrgate!bmers95!usenet
- From: hlam@bmerh136.bnr.ca (Hayward Lam)
- Subject: Category and Delegate questions
- Message-ID: <1992Nov13.053514.9063@bmers95.bnr.ca>
- Sender: usenet@bmers95.bnr.ca
- Organization: Bell-Northern Research Ltd.
- Date: Fri, 13 Nov 1992 05:35:14 GMT
- Lines: 56
-
-
- I'm new to NeXT and Objective C. These might be stupid questions but...
- Anyway. I'm studying this famous "Plotter" program, I have couple
- things that I don't understand.
-
- 1) What is Category?
- In the PlotView.h listing,
-
- @interface Object(PlotViewDelegate)
- - plotView:sender providePoints:(NXStream **)stream;
- - plotView:sender pointDidChange:(NXPoint *)aPoint;
- @end
-
- I can't find any reference of Category "PlotViewDelegate" anywhere
- in the program. What is it?
- Do the codes mean adding two more methods to class Object?
- Does that mean all Class' derived from Object will have the
- two new methods?
- The listing also has "setDelegate" defined. But in PlotController,
- this "setDelegate" is not invoked at all. Therefore, "delegate"
- remains uninitialized, right? Then how does PlotView know PlotController
- is the delegate?
-
- In "PlotController.h", theScrollView and thePlotView are defined
- as id. In method appDidInit,
-
- inputText = [theScrollView docView];
- ...
- [[thePlotView window] makeKeyAndOrderFront];
-
- How can theScrollView be used as a class to define inputText? Don't
- you initialize theScrollView first? like
-
- ScrollView *theScrollView = [ScrollView new];
- inputText = [theScrollView docView];
-
- Same question about PlotView.
-
-
- Any comments are welcome.
-
-
-
- Regards,
- Hayward
- Internet: hlam@bnr.ca
- ********************************************************************
- I only speak for my evil twin brother.
-
-
-
-
-
-
-
-
-