Building Applications

The simplest approach to create a new Nano-based application is to install the Xcode Templates, and allow Xcode to create a new project:

Demo Project

Project Structure

Projects created from an Xcode template link to Nano as a static library. This reduces build times if Nano is used in multiple projects, but is not a requirement. If you prefer, you can add Nano directly to your project.

The template project contains several standard groups:

  • Configuration (the .xcconfig files used to configure the target)
  • Prefix (the project prefix header, and the "build header")
  • Source (the project source code, organized as MVC).
  • Resources (icons, string tables, etc)

You may wish to use a similar grouping for your own projects, although no particular structure is required.

Application Model

Although the definitive reference is the source code, some of the basic concepts of the Nano application model are discussed here.

One of the most important headers for a Nano project is the "build header". This is contained in the Prefix directory, and defines application properties such as the name or version number.

These properties are used to populate the Info.plist file, and to configure the properties dictionaries of the NApplication and NDocument objects.

NApplication and NDocument both maintain a properties dictionary to control their behaviour, and expose these dictionaries to sub-classes to allow this behaviour to be customized.

The "build header" provides a simple way for new projects to populate these dictionaries with the same values used by their Info.plist file, however this approach is not required.

The only connection between the Nano classes and the sub-classes within the application are these dictionaries, since the application-specific build header is not visible to the Nano library.

Additional Resources

Applications built with Nano must include two extra resources in their bundle:

           Library/Resources/English.lproj/Nano.nib
           Library/Resources/English.lproj/Nano.strings

If your application contains multiple localizations, you may wish to consider localizing these files in order to localize any user interface displayed by Nano.

If you would like to submit a localization back to Nano, please see the contributing page.

System Requirements

Applications built with Nano require Mac OS X 10.4 or later and should link to the frameworks used by the stationary projects (all of which are standard frameworks such as Carbon, Cocoa, QuickTime, Accelerate, etc).

Although most of Nano will function correctly on 10.3, there are some issues relating to UTI support that means supporting this platform would require additional code.

If you are building an application with Nano, and require 10.3 support, please contact me to discuss this (if there is sufficient demand, it should be feasible to support 10.3.9).