Conceptual problem
Conceptual problem
- Subject: Conceptual problem
- From: Michael Norris <email@hidden>
- Date: Thu, 9 Jan 2003 18:01:01 +1300
Hi guys. I'm a bit of a beginner, but hope you can help me with a wee
"Objective-C conceptual problem" I'm having in my latest Cocoa project.
My question is: how do I send a message from a "view" class to a
"controller" class (MVC)? (At least I think that's my question...)
Here's the scenario: I have two classes in my current project:
"MyDocument.m" which is the NSDocument subclass that gets instantiated
for each new document, and "MyTableView.m" which is an NSTableView
subclass created to override a keyDown event that I want to capture in
an NSTableView in my document window.
The MyTableView class tests for the tab key being hit in the final row
of the TableView, and if so, I then want to send a "newEntry" message
to my MyDocument class. But how do I do that, seeing as my MyTableView
subclass doesn't know anything about the MyDocument instantiation?
For instance: [MyDocument newEntry] is obviously wrong, as the compiler
complains about "factory methods". How would I get a handle to the
current instantiation of the NSDocument class?
Or is this a conceptual problem I'm having? Should I be sending that
message somewhere else?
Cheers
-mike
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.