Exascale Exascale - 7 months ago 33
Objective-C Question

NSBrowser setRowHeight, not supported for browsers with matrix delegates

I have an NSBrowser and try to use setRowHeight, but I get the error:

"setRowHeight: is not supported for browsers with matrix delegates."

I really don't understand what this means, and if someone could help me out by either telling me how to fix it or even just what a matrix delegate is, it would be much appreciated.


A delegate is a helper object that you tell the NSBrowser instance about either by using -setDelegate: in code or hooking the delegate outlet up in IB (the NIB editor). It is commonly used to fill the browser's data, determine programmatically the layout options, etc.

If you have a delegate assigned in your NSBrowser instance, you are expected (required) to give the row height using the delegate method:

- (CGFloat)browser:(NSBrowser *)browser heightOfRow:(NSInteger)row inColumn:(NSInteger)columnIndex

Which will allow you to optionally set the row height on a per-row basis, but in your case, you can safely return a constant.