Why is IB improperly displaying my dynamic prototype table view cells - interface-builder

After upgrading to Xcode 7.1, IB no longer displays my table view cells correctly. My table view has 11 dynamic prototype cells defined. The cells in the screen shot are partially visible when the table is scrolled all the way to the top (in IB). Normally, I could just select the table and scroll to see the other cells. Now they are partially visible, or not visible at all. Is there some new setting that I'm missing?

Related

How to show scroller indicator in NSTableview when scrolling , hide when not scrolling

I am new in MacOS ,I want to show scroller indicator in NSTableview when scrolling , hide when not scrolling.
I am thinking to get the delegate of NSScroller , So i can detect when it scrolls,then hide/show it . Please help
Per the NSTableView reference page:
Table views are displayed in scroll views.
A table view itself doesn't know how to scroll. You have to put it inside a scroll view in order to scroll the table. If you're used to iOS and UIKit, that's a difference; UITableView inherits from UIScrollView, so on that platform a table view is a scroll view. In a MacOS project, if you insert a table into a view in Xcode's nib or storyboard editor, Xcode will actually insert a scroll view that contains a table view so you'll already have what you need. If you're creating the table in code, you'll need to also create the scroll view yourself.
Looking at NSScrollView, there's a property called autohidesScrollers which is...
A Boolean that indicates whether the scroll view automatically hides its scroll bars when they are not needed.
So, to get the behavior you're asking for, you need to set the scroll view's autohidesScrollers property to YES.
Of course, you can set that in the storyboard editor too, but again you need to look at the options for the scroll view, not the table view:

View based NSTableView and row heights

I'm beginning to try and build an OSX app.
I'm using NSTableView with it set as view-based, however I want the rows to wrap properly (so all of the text in each is shown at once) however I can't seem to find out how do to this.
Using the rowHeight delegate method seems to point to cell-based NSTableViews so I don't know if I'm doing that right or not.
First select NSTableView and then Size Inspector and set row height:
and then select table cell view's which you want change:
And if you want then you can move or resize your table view cell if you want.

Xcode 6.1?? Why does the NSTableView show only placeholder text?

I have been debating for a while on the upgrade to 6.1 and finally decided to do it - it may have been a mistake.
I have several NSTableViews bound to NSArrayControllers - all has been working well. After the upgrade, I added a new NSTableView and bound the table columns as usually and nothing!! only the place holder text "Table View Cell" appears in the cells.
I reinstalled Xcode 5, opened the project, and I can add a new NSTableView and bind to the NSArrayController and everything works fine.
Does anyone know what is going on? Do you have to bind the columns differently in 6.1?
In Xcode 5 and earlier, when you drag a table view out of the Object library in Interface Builder, it is an NSCell-based table view by default. In Xcode 6 and later, it's a view-based table view by default, with the cell views being NSTableCellViews with NSTextFields as subviews.
You can configure the "content mode" of the table view on the Attributes inspector at any time.
Furthermore, with that configuration for the cell view sub-hierarchy, you need to take extra steps to make the object value for the cell reflected in the actual cell views. See my answer here for the details.

Overlapping cells in static tableview built using storyboard

All,
I'm using the Xcode 6 beta to build an iOS8 project using storyboard and swift. In the storyboard, I've created a Table View Controller as my primary view when the application loads and have added a label to the first cell and a label to the second cell.
The table looks fine in the storyboard, but when I run the application, the cells overlap. This is a brand new project with no other changes made or code added.
You can see both the storyboard and the running application in the photo below. Any ideas on what could be driving this?
Additionally, when I try to add a button to one of the cells, I get a grey box that covers 90% of the view.
I think I've had this issue. Try making some Auto Layout connections from the label to the Content View of the cell, and from the table view (and its cells) to the containing view, to force the views to be the proper size.
The following worked for me.
Control-click and drag from your label to left side of the cell it's in. When the modal comes up, check the box for 'Leading Space to Container'.
Repeat the same Control-click and drag process for each side of the cell, selecting the relevant Auto Layout option when it appears.
(Optional) Try to Control-click and drag from your table view to the each side of the containing view (if there is one), and repeat the steps from above.
Hopefully this works for you.

How do I tell NSTableView not to resize all other columns when showing/hiding a column?

I have an NSTableView, and I have the ability for the user to show or hide columns dynamically (with a mail-style header context menu).
My issue is that if the table view is currently wider than it's scroll view (i.e. it's displaying a horizontal scroll bar) when a column is hidden or shown it resizes every single visible column such that they all fit on the screen again. How do I make it, well, not. I just want the hidden/shown column hidden/shown without any resizing of the other columns.
I tried setting the column resizing style to None is interface builder, but that didn't have any effect.
You can do this by selecting each column individually in IB and disabling the Attributes->Resizes With Table checkbox.

Resources