home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / next / programm / 7198 < prev    next >
Encoding:
Text File  |  1992-11-12  |  1.8 KB  |  67 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!utcsri!torn!nott!bnrgate!bmers95!usenet
  3. From: hlam@bmerh136.bnr.ca (Hayward Lam)
  4. Subject: Category and Delegate questions
  5. Message-ID: <1992Nov13.053514.9063@bmers95.bnr.ca>
  6. Sender: usenet@bmers95.bnr.ca
  7. Organization: Bell-Northern Research Ltd.
  8. Date: Fri, 13 Nov 1992 05:35:14 GMT
  9. Lines: 56
  10.  
  11.  
  12. I'm new to NeXT and Objective C. These might be stupid questions but...
  13. Anyway. I'm studying this famous "Plotter" program, I have couple 
  14. things that I don't understand.
  15.  
  16. 1) What is Category?
  17.    In the PlotView.h listing, 
  18.  
  19.     @interface Object(PlotViewDelegate)
  20.     - plotView:sender providePoints:(NXStream **)stream;
  21.     - plotView:sender pointDidChange:(NXPoint *)aPoint;
  22.     @end
  23.  
  24.    I can't find any reference of Category "PlotViewDelegate" anywhere 
  25. in the program. What is it? 
  26.    Do the codes mean adding two more methods to class Object?
  27.    Does that mean all Class' derived from Object will have the
  28. two new methods?
  29.    The listing also has "setDelegate" defined. But in PlotController,
  30. this "setDelegate" is not invoked at all. Therefore, "delegate"
  31. remains uninitialized, right? Then how does PlotView know PlotController
  32. is the delegate?
  33.  
  34.    In "PlotController.h", theScrollView and thePlotView are defined
  35. as id. In method appDidInit,
  36.  
  37.    inputText = [theScrollView docView];
  38.    ...
  39.    [[thePlotView window] makeKeyAndOrderFront];
  40.  
  41.    How can theScrollView be used as a class to define inputText? Don't
  42. you initialize theScrollView first? like 
  43.    
  44.    ScrollView *theScrollView = [ScrollView new];
  45.    inputText = [theScrollView docView];
  46.  
  47. Same question about PlotView.  
  48.  
  49.  
  50. Any comments are welcome.
  51.  
  52.  
  53.  
  54. Regards,
  55. Hayward
  56. Internet: hlam@bnr.ca
  57. ********************************************************************
  58. I only speak for my evil twin brother.
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.