Thread View: comp.sys.next.programmer
1 messages
1 total messages
Started by Hayward Lam
Fri, 13 Nov 1992 05:35
Category and Delegate questions
Author: Hayward Lam
Date: Fri, 13 Nov 1992 05:35
Date: Fri, 13 Nov 1992 05:35
48 lines
1873 bytes
1873 bytes
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.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads