this is an example of a custom inspector plugin. well actually it's a plugin-pair: one for the inspector, one for the debug objects.

The targets are BSImageInspector and BSImageDebugObject.

About the api:

########################
#   the debug object   #
########################

The debug object needs to implement the following: (it should be a subclass of BSDebugObject)
(see BSImageDebugObject.m)

- a class extension to the class that needs to be inspected (NSImage in this case).
	
	This is done by implementing +(Class)debuggerObjectClass in a new category, like BSDebugExtension in this example.
	(it should be the class that is defined in the file that is just edited)

- the initWithCoder:(NSCoder*)decoder method should be used to decode the data that was sent to Xcode

	In this example it simply decodes the targetObject. The inspector is working with this data, so nothing else has to be done here
	
- the _encodeWithCoder:(NSCoder*)encoder method can be used to encode the data that should be sent to Xcode

	The image debug object stores the tiff-representation of itself in targetObject. The tiff-representation is an instance of NSData, which can be encoded.

- the resulting bundle needs to have the extension bsDebugObject
- set the bundles NSPrincipalClass to the class you just created

########################
#     the inspector	   #
########################

The inspector has to implement this: (it should be a subclass of BSInspector)
(see BSImageInspector.m)

- a class extension to the debug-object class!!! (BSImageDebugObject in this case)... this is the class that was defined in the other part of the plugin
	
	Do this by implementing +(Class)inspectorClass in a new category of the previous class
	
- implement -(NSString*)nibName which returns the name of the plugins nib-file.

- use the awakeFromNib function to initialize your ui, but make sure you call the super implementation!
	
	The example is setting the image there. debugObject is an instance of the debug-object class mentioned above, so you can use it's targetObject according to what you stored there.

- the resulting bundle needs to have the extension bsInspector
- set the bundles NSPrincipalClass to the class you just created

########################
#   finishing touches  #
########################

compile the two plugins. make sure the bundle-extensions are correct.
you can double-click the bundles and BSInspectorInstaller should open them to install them at the right place.

restart Xcode and try the new plugins