I would like to use a custom NSFormatter to judge the length of a string inside of a NSTokenField.
I have implemented the NSFormatter and hooked it up within the xib and all that, now when I get to running my application with the formatter inplace connected to the NSTokenField I get this error:
2011-12-31 18:15:11.761 MyApp[4706:a0f] -[NSCFArray length]: unrecognized selector sent to instance 0xf4a530
(gdb) describe 0xf4a530
Undefined command: "describe". Try "help".
(gdb) p 0xf4a530
$1 = 16033072
(gdb) po 0xf4a530
<NSCFArray 0xf4a530>(
{
Format = "%01d";
FormatIndex = 0;
Name = "$Counter$";
},
{
Format = "";
Name = hey;
}
)
Now I understand that indeed the textcell being evaluated contains an array of items so I will need to probably turn these to a string but the place where this is erroring in my code is here:
//Set this so that user can't enter a super long amount and overflow the character array lower in the engine.
[fieldFormatter setMaximumLength:40];
Im just evaluating the fieldFormatter object and setting its member variable of int to 40... really shouldnt be evaluating the text yet... right?