NSSplitView inside tab view appears filled by first pane - cocoa

I have an NSSplitView inside an NSTabView. If the split view's tab is the one initially shown, it seems to work fine, but if the split view's tab is shown later instead, it appears with the first pane fully expanded and the second one collapsed. Because I want to use a thin divider for the split view, there is no way for the user to get out of this.
Returning NO from splitView:canCollapseSubview: doesn't help, even though I verified that it does get called.
As a workaround, I tried letting the split view's tab be initially shown, and then manually switching after the window is loaded (in awakeFromNib), but this did not fix it.
Is this a known issue with NSSplitView if it isn't initially shown? Is there a better way to apply the tab switching workaround? Or is there a better workaround?

I ended up getting around the issue by switching to RBSplitView. I also made a fork on GitHub to update the project to work with the latest Xcode.

Related

Is this normal Xcode behavior

I have a Text View Object on my storyboard that doesn't seem to render correctly.
I've seen this often and didn't know if this was a bug or normal behavior as it only renders a few lines:
However when I double click on the object:
All is visible.
Any work arounds or should I submit a bug report on this ?
Yes it's normal. When you double-click you edit the content that is bigger than the frame size.
It has always been like that, you can update the UITextView's frame.

Split View Controller showing only one view (Xcode 6)

I'm trying to get the split view controller working properly but apparently there's a bug in there or I'm missing something.
First of all, I've started a blank OSX Obj-C application, and in the Storyboard I've dragged the split view controller. Next, I've linked the segues from the main window controller to the split view and added two labels.
http://i.imgur.com/dlFObaF.png
When I build the project, it shows only the second page. Not to mention strange window size in the final build.
http://i.stack.imgur.com/IqRqr.png
I've tried everything.
This occurs in both vertical and horizontal split view.
Any suggestions?
I had the same issue myself today, but it's just the split line wasn't initiated properly.
To see, this, once you run your app, move your mouse toward the edge of the window and drag it, you will now see another view emerging.
To my best knowledge, I do not know how to fix this in IB or in code. Apparently NSSplitViewController does not have a property like UISplitViewControllerAutomaticDimension. Would appreciate if someone can contribute to this.
Edited: Found an answer via another thread. Basically, try to add some constraints to the subviews inside each view and that should prevent the size of a view to be zero. In my toy example, adding margin constraints to my buttons worked out well.

IOS/Xcode: storyboard screen turning black

I am just learning Xcode. I did something that caused a view controller to turn black below the navigation bar when you build app.
It looks white in storyboard.
Also, when I pull a label onto the storyboard, it aligns to the left margin and does not show the drag boxes around it.
I may have inadvertently clicked something but when I compared it in attributes and identity inspectors line by line to another project, nothing seems amiss, i.e. everything is the default value.
Has anyone run across this?
There is not code in associated class that would cause this as it is generic i.e. plain vanilla.
Would appreciate any suggestions. Thx.
With that little information i'd say you removed the root view of the controller?
Either way, you say there is no code, so I'd suggest you simply delete that controller and create another one (bottom right, objects, viewcontroller). Since it's empty you're not gonna lose any data or time :)
Then link it to your class in the Identity Inspector and you're good to go as if it was a new one.

Rearrange Tab Bar items not working as expected

Following on from this question, I have so far been unable to rearrange tab bar items in my iPad app.
I have zoomed in as far as I can go and double-clicked the tab bar controller so that it is highlighted in the Document Outline inspector.
I then try to click-drag individual items left or right but nothing happens, i.e. I'm unable to select them.
Following the comments on the other question, I've tried clicking on another .h or .m file, then switching back to the Storyboard. I've also tried closing x-code and restarting but neither made any difference.
Can anyone tell me what I'm doing wrong?
In the end I took the brute force approach of deleting the segues then reconnecting in the preferred order.
Not particularly elegant but it did the job.

NSTableView redraw not updating display, selection sticking

Although I know of a solution to this problem, I am interested if someone can explain this solution to me. I also wanted to get this out there because I could not find any mention of this problem online, and it took me several hours over several days to track down. I have an NSTableView behaving strangely regarding redraws and its selection. The problem looks like this:
Table contents fades in, instead of appearing instantly upon it's appearance on screen. When scrolling through the contents, the newly appearing rows also fade in. When you make a selection (single or multiple), and scroll it off screen, then make another selection (that should replace, not add-to first selection), the first selection does not get cleared properly. If you scroll back to it, it is still there, in addition to your new selection. This is a display-update problem, not selection problem - i.e. your new selection is valid, it is just displayed wrong.
I tracked this through the NSArrayController I was binding to, the underlying Array, sorting, all the connections, and settings, etc., but all that has nothing to do with it.
What solved the problem was:
In the View Effects (right-most) Inspector, uncheck "Core Animation Layer" for the Window's main view.
Can anyone explain what is happening here, and perhaps improve upon the solution ?
It looks like Core Animation and NSTableView aren't getting along so well. The "fading" effect is a by-product of the way core animation works. When you have core animation in one view, it is also enabled in all of that view's subviews.
I don't recommend using core animation on the Mac unless absolutely necessary, because some interface elements (NSTextView and NSTableView, for example) aren't compatible with it. iOS has much better support for table views and such using core animation, mainly because it was designed with core animation in mind.
I know that some more simple UI elements are compatible (NSTextField and NSButton, for example).
If you absolutely need core animation in the rest of the window, put all the other views in a subview of the content view, while leaving the table view directly in the content view. You can then enable Core Animation in the other view.
Commenters, feel free to add to the list of what is and isn't compatible.

Resources