NSTextField subclass needs cell subclass as well - how?
NSTextField subclass needs cell subclass as well - how?
- Subject: NSTextField subclass needs cell subclass as well - how?
- From: Graham Cox <email@hidden>
- Date: Thu, 08 Oct 2015 11:50:54 +1100
I have a NSTextField subclass that must currently also always have a NSTextFieldCell subclass internally (which in turn is needed only to provide a custom Field Editor when needed).
In 10.10, cells are deprecated, though the cell is still there. I previously returned the custom class from +cellClass, but this is now deprecated and no longer called. The documentation states that +setCellClass: can be called from -awakeFromNib to set a custom cell class, but that method is also deprecated and it doesn’t do what the documentation says anyway (if it ever did - first time I’ve tried this).
What can I do to make sure that the text fields get the necessary custom cell?
I *can* set the cell class in IB, and that’s fine as such, but I’d rather do it in code, because I have hundreds of these fields and it would be a lot simpler to simply set the cell class once in code instead of hundreds of times in IB.
I understand that cells are going away, but there currently doesn’t seem to be a replacement for returning a custom field editor for a given text field that doesn’t involve its cell. If there is, and I’ve missed it, that would be a better solution, so maybe someone could point me at what I should be doing.
—Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden