[Drawkit] mMainDrawingView outlet connection when using DKDrawingDocument subclass
Graham Cox
graham.cox at bigpond.com
Wed Jul 1 23:23:37 PDT 2009
On 02/07/2009, at 3:59 PM, Allan Daly wrote:
> At this point I would have thought that the IBOutlet defined for
> mMainDrawingView would now be available to connect to in the File's
> Owner list since MyDocument is a subclass of DKDrawingDocument. But
> it's not.
>
> Is the way that I'm linking in the DK framework causing problems?
I don't think so. It sounds like you've done the right thing setting
up the project and linking the framework.
> Since MyDocument is a subclass of DKDrawingDocument, should the
> IBOutlets defined in the superclass be available through the subclass?
Yes, they should.
>
> I'm probably missing something very basic and easy here. I hope one
> of you can point it out for me.
>
I think it could be something as simple as IB not always picking up
the files - maybe it can't automatically do that with framework
classes. (?) But anyway, try dragging DKDrawingDocument.h into IB's
main window. That will cause it to reparse the header and hopefully
you should then see the outlet. If it still doesn't show up, let me
know and I'll have another think.
Another thought occurs - since IB is now more tightly integrated with
Xcode, it may be relying on certain file locations to find things. For
debugging, you need to set up the project so that there is a common
build location for both DK and the app you're building - IB may be
relying on that. A sure symptom of that not working is when you run
your app from Xcode it barfs on launch with a 'framework not found'
error. To solve this, open the project build settings and add this
under 'Build Products Path' ../../../DrawKit/Trunk/Source/build (you
may need to change the exact path depending on how your app project is
organised - this is mine because my app follows the same structure as
DK itself with {Dev Folder}/MyApp/Trunk/Source and DK is also inside
the {Dev Folder}, so I back up to there and then back down again
(heaven help me if I decide to reorganise!).
This has the side effect of dumping your app builds into DK's build
folder, but this seems to be how Xcode 3+ wants you to do things.
--Graham
More information about the Drawkit
mailing list