I am building a dynamic form in a Cocoa application and am planning to use the NSForm object to add entries to it from an array.
Some of the entries require a text input, but some require a boolean input (i.e. a dropdown list), and some even require a file input (i.e. a place to upload an image or a movie or sound file).
It seems that an NSFormCell is only equipped to handle text. My question is: Should I subclass NSFormCell and if so, what would be the best way to do this? Are there any better ways to do this?
Thank you for any help you can offer!
You might want to look into using an
NSMatrixinstead. From theNSFormdocumentation,NSFormis simply a subclass ofNSMatrixwith some convenience methods geared specifically towards creating a text form in a certain configuration.NSMatrixwill let you use any cell you want for any cell (using theputCell:atRow:column:method). Thus, you could have a two-column matrix, with the left column being composed entirely of text cells, and the right column being whatever type of cell you want.