Some Basic (probably) Questions

Hi All,
I’ve got a few fundamental conceptual things I’m trying to wrap my head around and I’m hoping that someone can clear a few things up for me.

First off, what exactly is the appdelegate file? I’m thinking of it as the “main” controlling file. The one where handlers like “awake from nib” will be called. It’s also the “controller” for my gui elements. Does that sound close?

Secondly, if for organizational purposes, I want outlets and actions from a file other than the appdelegate, how do I do that? I know I saw an example of it in one of the tutorials I’ve worked through, but they’ve all started to blur and I’ve lost track of it.

Thirdly, related to the above, how are people out there organizing large applications. My original app was a mess, and I went through a “clean up phase” where I broke it into multiple files and incorporated script objects, to give it more of an OOP feel. I think that I was only partially successful, so I’m wondering how other people are handling big applications. I could see where it would be possible to go nuts with script objects (e.g., each GUI element a script object) or perhaps organize files by windows - a separate applescript file for each?

Fourthly (is that a word :-)), when I add a new script file, it is automatically made a child of NSObject. What happens if I delete this line. Is the file then an ordinary applescript file with none of the ASObjC capabilities and gotchas? Will it function within my project?

Thanks in advance for any help.

It’s just a starting point. In most cases you’d use it as your main controller script, and it is made the application’s delegate because, well, you usually need a delegate for the application.

You make an instances of the class. Drag a blue cube NSObject into the .xib window, and in the Inspector’s Identity panel change its class to suit.

There’s no simple answer to that. ASObjC makes it easier to break up code because objects can call handlers in other objects, but just because you can do something doesn’t mean you have to.

At the moment, probably nothing. But it should cause problems, and one day might. If you want a “standard” AS file, you can probably add it as a resource and use run script; once you load it into your project, it’s running in ASObjC courtesy inheritance.