Adding an Object to ORCA

 

The steps to write a new object and add it to the ORCA project are given below. The easiest way to start is to use an existing object as a template for a new object which is first constructed and tested as a copy of the existing object. Then only after the copy is working exactly as the original object you can change the copy into the final object with the required new characteristics and behavior.


Before you start, make sure you have installed ORCA’s InterfaceBuilder plugins. See Installation. And make sure that you have added them to InterfaceBuilder’s plugins (in the InterfaceBuilder preferences).


Creating a new object


Choose an existing object that is similar to the new object. The more similar it is the required final object the easier adding in the new characteristics will be.

Make a duplicate copy of the existing object's folder and place it somewhere in the ORCA folder hierarchy that makes sense.


  1. Rename the new folder

  2. cd into the folder and do the following:


  1. 1)Delete the .svn folder -- NOTE that you MUST do this or you will totally confuse subversion when you     commit your new object -- this step is obsolete now.

  2. 2) Delete the .svn folder that is inside your .nib files -- NOTE that you MUST do this or you will totally confuse subversion when you commit your new object. -- this step is obsolete now.

  3. 3)Rename the rest of the files to what ever makes sense for the new object. Try to follow the ORCA conventions:


        ORxxxxModel.m/.h for the model code

        ORxxxxController.m/.h for the controller code

        ORxxxxDecoders.m/.h for the decoders (if data decoders are needed.)

        xxxx.tif for the icon file

        xxxx.nib for the nib file


  1. Drag the new folder into the ORCA Xcode project, putting it into the same relative location in the project hierarchy as it is in the overall ORCA disk file hierarchy. Make sure that you add it 'Relative to Project' in the confirmation dialog sheet.

  2. Edit each of the files and replace all instances of the class name with the new name, i.e. if you started with ORShaperModel you would replace 'Shaper' with your new class name thruout the file. Be careful with case as the class name may occur in different forms thruout the file. These name changes should include variables that include the name of the class. Again, be careful about case.

  3. For pre-XCode 3 only: open up the .nib file in Interface Builder and drag your new ORxxxxController.h file into the .nib dialog.

  4. Select the file's owner icon, open the file's owner inspector and change the custom class to be your new class. Important!!


At this point you should be able to compile and build the project without error. If you get errors, fix all of them before moving on to the next step.


Adding the Object to the Catalog


At this point the project should compile, but the object is not yet available for use. It must be added to the object catalog first.


  1. Open the Catalog.nib file.

  2. Find a location for the new object.

  3. Select and copy one of the existing objects.

  4. Select the new object and open its inspector. Go to the Identity Inspector section and change the Tool Tip to be the name of your new class --'ORxxxxModel'


That's it. Save the Catalog.nib file, build and run ORCA. Your new object should now show up in the catalog and be able to be dragged into the configuration window.

Your new object should come up and act just like the object that you copied it from.


Modifying the Object


Unfortunately there is no way to list a set of steps on how to convert your new object to do what you want it to do. Just go for it and good luck.


SVN


Don't forget to add your new object to to the subversion repository if you have been allowed check-in privileges. Otherwise, send your code to Mark Howe for inclusion.  The Catalog.nib and the project will have to committed as well.