So, I've made a StringFormatter paletter for interface builder. It lets me use some Fortran formats because it's for formatting an input file to a Fortran program.
Anyways, it doesn't attach to text fields the way the built in NSNumberFormatter does, or like NSDateFormatter.
Does anyone have any idea of what I have to do to get it to attach to a text field?
Code:
@implementation StringFormatterPalette
- (void)finishInstantiate
{
StringFormatter *formy;
formy = [[StringFormatter alloc] initWithLength:30];
[self associateObject:formy ofType:IBWindowPboardType withView:view];
}
@end
@implementation StringFormatter (StringFormatterPaletteInspector)
- (NSString *)inspectorClassName
{
return @"StringFormatterInspector";
}
In the code, view is a custom view used for dragging, and is attached to my view in IB.
I am guessing that I need a special ofType thing, other that IBObjectPboardType. Any ideas? I would like the behavior to match the built in formatters in IB.