[Drawkit] NSDocument based application, nil drawing

V1ru8 info at v1ru8.net
Fri May 22 10:24:15 PDT 2009


Hi,

I'm totally new to DrawKit and I have some problems to understand its  
architecture. I set up a new Document Based application. Added a  
scroll view, a DKDrawingView and sub classed DKDrawingDocument.  That  
works perfectly and I can add objects to my document (via drag and  
drop or by copy and paste).
But now I want to access the DKDrawing of my document.  But when I  
call "drawing" on the document  only nil is returned. On the  
DKDrawingView I found the following line:

"the drawing we created automatically (if we did so - typically nil  
for doc-based apps)"

That has something to do with it?! I think I just don't get something  
about the main concept of DrawKit. Shouldn't DrawKit automatically  
generate a new DKDrawing when the DKDrawingDocument is initialized? I  
tried to set the drawing to a new DKDrawing. But then the document is  
just blank and I can't even add something.

BTW DrawKit looks like a really great framework!

Thomas




More information about the Drawkit mailing list