Various kinds of document within an app

So far, still working with the GUI without much coding or linking, I have things working with a single kind of document.

So I have, for a text editing sort of document:

  Classes/MyDocument.applescript
  Resources/MyDocument.xib
  Interface Builder Files/MyDocument.xib

and I suppose the last two are identical. I also have a palette created within MyDocument.xib and displaying well.

Now I want I want a table sort of document as well but if I create it within MyDocument.xib, it never appears. Do I need to create a new .applescript/.xib pair for the table document?

JD

Yes. But a suggestion: you’re getting way ahead of yourself. Get one type actually working first.

Well, in fact I have now got both the table window and the editing window within MyDocument.xib by creating a new second Window instance in with First Responder etc. and dragging it into the workspace. I think the mistake I made previously was to drag it straight from the Library to the workspace.

You say I do need to create a new pair. Is what I have done going to make the situation impossible?

We all have different ways of learning things, and doing things the school way is not my way. I learn very quickly by cramming a lot of mistakes into a short time. If that’s getting “ahead of myself” in your book, so be it.

JD

Pretty much. Well, perhaps not impossible, but certainly it would require a great deal more work. There is a correct way to work with the document frameworks, and you venture far from it at your own peril.

Go for it. But be aware that one of the shortcomings of AppleScriptObjC is that debugging is very limited, so sometimes it’s difficult to know just what mistake you’ve made – that makes trial-and-error a lot harder than it should be.

And that comment wasn’t in reference to my book; I don’t actually cover an example using multiple document types that don’t share the same window. (I’ve never actually done that.) It was more a suggestion that it might be easier to get one document type working satisfactorily, and then add to it.

An amusing misunderstanding here :). I’m so new to the game that I wasn’t even aware you’d written a book. I was using the expression “in your book” in its colloquial sense!

JD

See my sig below. FWIW, it will answer a lot of your questions.