![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
This is a very basic thing, but at least under Tiger (10.4) there are different ways of doing it. Even if you have a newer version of IB, many tutorials date back a considerable time, and they're still perfectly good tutorials, and the difference isn't always obvious when you just read them, so this remains relevant.
When you create a project, you will create an application controller (a subclass of NSObject). At least, you will do so if you're a good citizen sticking to the MVC model.
In the Classes tab, select your App Controller, and add actions and outlines using either the items in the Classes menu, or the attributes in the Inspector palette.
When you create the files for your application controller, these outlets and actions will be automatically added to your .h and .m files.
So far, so good, and this is what most tutorials will tell you.
When you want to add further outlets and actions, you _can_ do the same. This will lead to IB creating new files, which you will then need to merge, because all the code you've written is in the old, about-to-be-overwritten file. That's a lot of effort (and a lot of potential to go wrong) so my advice would be not to do it.
The other way is to add outlets and actions to the files manually, select your class in the classes tab and use the 'read AppController.h' item in the Classes menu. Your actions and outlets will appear in the attributes list, and you can connect them as usual. (That is, as long as you remember to implement them in AppController.m)
(This post was sparked by a fifteen minute odyssey following the line 'we add an outlet' without saying how to actually do it. Once you've done it x many times, it will be second nature. Until then, it's not the most intuitive thing ever.)
When you create a project, you will create an application controller (a subclass of NSObject). At least, you will do so if you're a good citizen sticking to the MVC model.
In the Classes tab, select your App Controller, and add actions and outlines using either the items in the Classes menu, or the attributes in the Inspector palette.
When you create the files for your application controller, these outlets and actions will be automatically added to your .h and .m files.
So far, so good, and this is what most tutorials will tell you.
When you want to add further outlets and actions, you _can_ do the same. This will lead to IB creating new files, which you will then need to merge, because all the code you've written is in the old, about-to-be-overwritten file. That's a lot of effort (and a lot of potential to go wrong) so my advice would be not to do it.
The other way is to add outlets and actions to the files manually, select your class in the classes tab and use the 'read AppController.h' item in the Classes menu. Your actions and outlets will appear in the attributes list, and you can connect them as usual. (That is, as long as you remember to implement them in AppController.m)
(This post was sparked by a fifteen minute odyssey following the line 'we add an outlet' without saying how to actually do it. Once you've done it x many times, it will be second nature. Until then, it's not the most intuitive thing ever.)