[Top]

SM2DGraphView Getting Started


Installation

The SM2DGraphView framework consists of a couple of Xcode projects, the source code targeting the 10.4 SDK and 10.5 SDK, source code for an Interface Builder 3 plugin and an Interface Builder 2 palette, this documentation, and pre-built versions of the framework, IB plugin and palette, and a 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 "10.4 Min" folder if you are targeting your apps to run on Mac OS 10.4 or later, or the "10.2 Min" or "10.1 Min" folder if you're developing to target an older system. If you want to use Garbage Collection you can use the "10.4 Min + GC" files. If you need to use the 64-bit framework or any other combination of requirements, you'll need to build it from code.

  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 Interface Builder 2.x, copy the SM2DGraphView.palette bundle into your /Developer/Palettes folder. If there is no Palettes folder in your /Developer folder 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.

Building the Framework

If you have Xcode 3+

The Interface Builder 3.x plugin is only built in the SM2DGraphView_10_5_sdk.xcodeproj project. You will want to first build the "All" target with the "Release-32bit" build style. This will produce the needed Interface Builder 3 plugin within the SM2DGraphView.framework. Then you can build whatever config you like of the framework from the 10_5_sdk project file.

The IB3 plugin, if it exists within the build folder, will be copied into the frameworks produced by the SM2DGraphView_10_4_sdk.xcodeproj. This allows you to target older operating systems (10.1 through 10.3), yet still include the IB3 plugin for development.

If you have Xcode 2

The Interface Builder 2.x palette is pre-built in the distribution, but you can build it yourself. Open the SM2DGraphView_10_4_sdk.xcodeproj project. You will want to build the "IB2 Palette" target with the "Deploy-Embed-10_2_Min" style.

Any Xcode version

You must have the source code installed in a place where you have write access. Open the SM2DGraphView_NN_N_sdk.xcodeproj file in Xcode. There are four targets in the project; you can build any of the three targets.

  1. 10.5 & 10.4 SDK - All - Build all of the targets in the project.
  2. 10.5 & 10.4 SDK - Framework - Builds the framework and copies it into your ~/Library/Frameworks folder.
  3. 10.5 & 10.4 SDK - Graphing.app - Builds the sample application showing off some of the capabilities of the graph view; also builds the framework if necessary.
  4. 10.5 SDK only - IB2 Palette - Builds the Interface Builder 2 palette.
  5. 10.4 SDK only - IB3 Plugin - Builds the Interface Builder 3 plugin; also builds the framework if necessary.

Build Configurations

The configurations included in the Xcode projects should be sufficient for most applications. If your app has special config needs, feel free to modify the stock configurations or even pull the source code files themselves into your own project (so they will be built with your config settings) instead of having the separate framework.

The Xcode 10.4 SDK project has four builds styles explained below.

  1. Debug - 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 framework that will run 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 of the shading code.
  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 framework that will run 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 framework that will run on Mac OS X 10.4+ on PPC and Intel Macs. All capabilities are present in this build config.

The Xcode 10.5 SDK project has six builds styles explained below.

  1. Debug - 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. Release-32bit - Builds for deployment (no debugging symbols) for embedding the framework in your own application's Frameworks folder. The result is a Universal Binary framework that will run on Mac OS X 10.4+ on PPC and Intel Macs.
  3. Release-32+64bit - Builds for deployment (no debugging symbols) for embedding the framework in your own application's Frameworks folder. The result is a four-way Universal Binary framework which has both 32 and 64 bit support for both PPC and Intel that will run on Mac OS X 10.5+. Note: The Interface Builder 3 plugin is built only with 32 bit support (because IB doesn't support 64 bit plugins).
  4. Identical styles with GC in names - Garbage Collection support is turned on in these styles, otherwise identical to the three styles above.

Setting up the .plugin in Interface Builder 3.x

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

  1. Launch Interface Builder 3.x.
  2. Use the Interface Builder > Preferences... menu command and choose the "Plug-ins" preference pane.
  3. Click the + button at the bottom-left of the table.
  4. Navigate to the location of the SM2DGraphView.framework file and select it.

That's it! The graph plugin icon should show up in the Library window. You can drag a graph or pie chart object from the library 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.

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. Use the Tools > Palette Preferences..., or you can use the Interface Builder > 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.


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


© 2002-2009 Snowmint Creative Solutions LLC (Last Updated 2009-04-13)