Is it possible to design NSTableView cells using Interface Builder? (not for iOS apps)
Asked Answered
V

2

5

Is it possible to design NSTableView cells using Interface Builder? I know this is actually possible if your project is for iOS but somehow IB does not render the cell container if its for Mac OS X.

Valediction answered 12/8, 2010 at 13:20 Comment(0)
B
7

Im not sure if Amy gave that answer when this couldn't be done before, but this can be done quite easily on interface builder.

It can be done using view-based table view cells (instead of cell based) shown in the apple docs. There's is even a decent example you can download from the reference site.

Bobker answered 5/8, 2012 at 2:9 Comment(0)
S
2

No. The reason it's possible on iOS is because UITableViewCells inherit from UIView. Interface Builder lets you lay out views by putting other views within them.

On the desktop, for performance reasons from back when NextStep ran on 16mhz computers, NSCell does not inherit from NSView. A cell, on the Mac, does not have its own coordinate system or subview hierarchy, so it doesn't make sense to edit it in Interface Builder: you couldn't put other views within it!

So to make a custom cell, you need to draw everything with drawing functions such as CoreGraphics. You can't just drop in an NSImageView, you have to draw the image directly.

Schechter answered 12/8, 2010 at 14:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.