Xcode 4.4.1, Lion 10.7.4, desktop app For some reason the penny hasn't dropped and I need help.
Using BezierPathLab as example code I am trying to make (0) a Document app (1) The window has 2 objects (a) an NSColorWell and (b) a Custom View from my sub-class MyView : NSView (2) MyView.h has IBOutlet NSColorWell *startColorWell; and - (IBAction)changeStartColor:(NSColor *)sender; (3) I can connect startColorWell as a referencing outlet to the NSColorWell The Problem (4) I am not able to connect the NSColorWell itself to the IBAction (Ctl drag) that is in the MyView.h file (i.e. as a selector) But (5) If I move the IBAction into the NSDocument.h I can make the connection. In fact that's what I did to start with and it generated the IBAction definition (as per above).
I understand that NSDocument is not a view (but basically a model+controller). I understand that the BezierPathLab is not a Document app.
Nevertheless what is it that I am not doing or not understanding about why I am not able to connect the 2 objects startColorWell and changeStartColor in step (4).
The colorWell is in the window content area and is a view; my Custom View is in the content are. So I'm thinking I should be able to have the colorWell invoke the changeStartColor method which it does if it's in the Document (but not if it's in my sub-class).
Apparently not, at least not in the way I've attempted to do it.
As I said… the penny hasn't dropped yet. All I conclude at the moment is that the difference between the BezierPathLab and my app is that mine is a Document app and the Lab is not.
TIA for your help…
|