Skip to topic | Skip to bottom

You are here: ProductDocumentation > MaxUBSDK > MachAnatomy
ProductDocumentation.MachAnatomy r1.2 - 12 Jun 2006 - 19:54 - DavidZicarelli topic end


Start of topic | Skip to actions

Anatomy of Max Mach-O External Objects

A Max Mach-O object is a bundle -- also known as a package. This means that it appears to be a file in the Finder, but it is really a folder containing other files and folders. The outer folder must end with the extension .mxo. If it does not, Max will not load it. This requirement applies to both Max 4.5 and Max 4.6.

If you want to look inside any package in the Finder, control click on the package and choose Show Package Contents. Since it is useful to do this on a Max external object in 4.6 in conjunction with this discussion, we'll examine the external object dial in the max-startup folder.

The Contents Folder

When you open up dial.mxo using Show Package Contents, you'll see a single folder called Contents. This is the standard for most packages in Mac OS X (check out a few applications to verify this for yourself).

Inside Contents, there is one file, Info.plist, and two other folders, MacOS and Resources. The Info.plist file contains properties (plist is short for property list) with information (info is short for information) about your object.

The Info.plist file

Double-click on the Info.plist file and the Property List Editor application will open. You can also edit the property list with a text editor but the Property List Editor doesn't require you to grasp the XML format of the file. As described below, there are two important properties in here: CFBundleExecutable, which names your object's executable file, and CFBundleIdentifier, which also names your object, but serves as a kind of unique identifier for the code within the operating system. The CFBundleIdentifier can be anything, but the CFBundleExecutable name must be correct, otherwise your object will not work.

You can add your own properties to the Info.plist file, but you'll have to learn Apple's wonderfully wordy Core Foundation API to access them.

The PkgInfo File

The PkgInfo file resolves a conflict with a word processing application called SubEthaEdit, which creates documents with the .mxo extension. If a user does not have SubEthaEdit installed, this conflict will not arise, but of course you can never be sure of where your external object will be used. PkgInfo files consist of eight characters: the package's type code followed by the signature code of the application that owns the package. This provides the OS with another way to describe your bundle package so it is not seen as a mere folder.

The eight characters for the Max external PkgInfo file are iLaXmax2.

This file can be generated automatically by Xcode. We'll discuss how to do it in the Details About Xcode Projects section.

The MacOS folder

The MacOS folder contains a file with the executable (compiled) code for your object. There isn't a lot of flexibility provided by the Xcode environment for naming the executable file something different from your external's enclosing .mxo folder, so it's not even worth trying to do it.

The Resources folder

If your object has any traditional Mac resources, they can be added to your project and will be gathered together into a file with your object's name and a .rsrc extension. The name must match everything else: the executable in the MacOS, and the enclosing folder name ending in .mxo. If not, the resource file will not be opened when your external object is first loaded, so any attempts to access resources within the file will fail.

Another important thing to note about this .rsrc file is that it is a data-fork resource file. Data fork resource files can be opened by the Resorcerer application, but not by the old classic ResEdit application.

You can also store other files in the Resources folder, such as .icns files for icons. But you'll have to open them yourself.

Many, if not most, Max objects do not have Resources and this folder will not be created for them.

Other folders and files can be added to the Contents folder of a bundle, but you'll have to find and open them yourself. Still, this may be a nice way to package items specific to your object that users don't need to see.

Next: Copying Projects

Return to the Universal Binary SDK Table of Contents

-- DavidZicarelli - 04 Apr 2006
to top

-->

You are here: ProductDocumentation > MaxUBSDK > MachAnatomy

to top

Copyright © 2007 Cycling '74. All Rights Reserved.

...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT... porn free porn