[Top]

SM2DGraphView Getting Started


Installation

The SM2DGraphView framework consists of an Xcode 2.4 project, and a much older Project Builder project file, the source code itself, an Xcode 3 project and source code for an Interface Builder 3 plugin, this documentation, and pre-built versions of the framework, Interface Builder 2.x palette, and sample application.

Simple installation of pre-built products

The easiest way to install the SM2DGraphView framework for use in development is to copy the pre-built files to appropriate locations on your hard drive. Use the files in either the "Min 10.4" folder if you are targeting your apps to run on Mac OS 10.4 or later, or the "Min 10.2" or "Min 10.1" folder if you're developing to target an older system.

  1. Copy the SM2DGraphView.framework folder into your ~/Library/Frameworks folder, or your /Library/Frameworks folder. Placing the framework into your home directory library makes it available only to you; placing it in your main /Library/Frameworks folder makes it available to any user who logs in to your computer.

  2. If you're using Xcode 2.x and Interface Builder 2.x, copy the SM2DGraphView.palette bundle into your /Developer/Palettes folder. If there is no Palettes folder in your /Developer folder, simply create that folder first, then copy the SM2DGraphView.palette file into it.

Installation of source code

Copy the contents of the distribution to your hard drive in a location where you have write access. You can place it in your ~/Documents folder, in your /Developer folder, or elsewhere. After you build the framework (see below) you may need to copy some of the files to other locations on your computer.

Setting up the .palette in Interface Builder 2.x

The SM2DGraphView distribution includes a palette that can be used in Interface Builder 2.x to allow easy addition of graph view and pie chart view objects to your nib files. Once you've installed the SM2DGraphView.palette file onto your hard drive, either by following the simple installation instructions above or by building the palette from the source code, you can add the palette to Interface Builder. Once this is done, you shouldn't need to do it again unless you move the SM2DGraphView.palette file on your hard drive.

Later versions of Interface Builder 2.x automatically loaded palettes that are placed in the /Developer/Palettes/ folder. If the palette doesn't load automatically, follow these directions:

  1. Launch Interface Builder 2.x.
  2. From the Tools menu, choose Palette Preferences..., or you can use the Preferences... menu command and choose the Palette preferences.
  3. Click the Add... button.
  4. Navigate to the location of the SM2DGraphView.palette file and select it.

That's it! The graph palette icon should show up in the palettes window. You can drag a graph or pie chart object from that palette into your own nib files. You can hook up your data source and delegate objects in Interface Builder, just like with using an NSTableView or NSBrowser object. When you show the attributes of a selected graph or pie chart object in Interface Builder, you'll see an inspector that lets you change most of the settings for the view. You can also change any of these settings at run time in your own code.

Building the Framework

You must have the source code installed in a place where you have write access. Open the SM2DGraphView.xcodeproj file in Xcode, or the SM2DGraphView.lproj file in Project Builder. There are three targets in the project; you can build any of the three targets.

  1. IB Palette - Builds the Interface Builder palette; also builds the framework if necessary.
  2. Framework - Builds the framework and copies it into your ~/Library/Frameworks folder.
  3. Graphing.app - Builds the sample application showing off some of the capabilities of the graph view; also builds the framework if necessary.

If you have Xcode 3

There is a folder with it's own source code for the Interface Builder 3 plugin. You should open the Xcode project found there and build it FIRST. Then follow the directions above to build the framework. The IB3 plugin will be copied into the framework that you build with the main SM2DGraphView.xcodeproj file.

Build Configurations

The Xcode project has four builds styles explained below.

  1. Development - This builds everything with full debugging symbols on. The build is targeted at whatever processor (Intel or PPC) and operating system version that you are currently working on. Also, the framework is built to be embedded (see below).
  2. Deploy-Embed-10_1_Min - Builds for deployment (no debugging symbols) for embedding the framework in your own application's Frameworks folder. The result is a Universal Binary that will work on Mac OS X 10.1+ on PPC and 10.4+ on Intel Macs. Note that the bar graphing capabilities of this configuration are limited to have no gradient shading due to the inability of Mac OS X 10.1 to allow weak linking.
  3. Deploy-Embed-10_2_Min - Builds for deployment (no debugging symbols) for embedding the framework in your own application's Frameworks folder. The result is a Universal Binary that will work on Mac OS X 10.2+ on PPC and 10.4+ on Intel Macs. All capabilities are present in this build config.
  4. Deploy-Embed-10_4_Min - Builds for deployment (no debugging symbols) for embedding the framework in your own application's Frameworks folder. The result is a Universal Binary that will work on Mac OS X 10.4+ on PPC and Intel Macs. All capabilities are present in this build config.

General Usage - also how to embed the framework in your app


© 2002-2008 Snowmint Creative Solutions LLC (Last Updated 2008-02-15)