NSSplitViewController's 'view' outlet should not point to its NSSplitView; use the 'splitView' outlet instead

I've been developing a macOS app using a storyboard that defines a main window with toolbar and splitview. It's written in Swift 3 (I have not migrated to Swift 4 yet.) The splitview has a pane for graphics and another for a text log; both scroll. I have view controllers for all three; the two subsidiary scenes are ited to the split view with relationships. This worked up until today when I installed Xcode 9 beta 4. (Yes, I have beta 3 in the trash at the moment and can revert)


Upon cleaning the build folder and compiling, I get the error `NSSplitViewController's 'view' outlet should not point to its NSSplitView; use the 'splitView' outlet instead However, the NSSplitViewController subclass has no outlets defined; its two children arrange to tell it of their existence in their viewDidLoad methods. Moreover, I don't seem to be able to create an outlet between that window and its controller. I now also note that the split drawn in the split view controller's scene is horizontal instead of vertical as it had been. I don't see a way to change that. (I can't run the app, so I don't know if it matters. I suspect it does.)


The net result is that I can't see what the error is trying to tell me. The error prevents the application from building and running, whereas with beta 3 it worked. I'm hoping someone can explain what Xcode is telling me and how to fix it.

Replies

Did you have a look here ?

h ttps://developer.apple.com/documentation/appkit/nssplitviewcontroller/1388907-splitview


Seems to answer both questions :

- vertical vs horizontal (default setting)

- splitView seems to be a built in property ; can you create an outlet from splitView (which should show as a property of the object in the navigator)

No, it didn't help - I'd already seen that. To recap:

  1. Indeed splitView is builtin, as is view; I use neither of them (I have protocols defined that let the individual views tell the splitviewcontroller aboutot themselves). Those two properties are not connected as an outlet anywhere I can see. For that matter, trying to connect either one of them somewhere doesn't seem to be possible in IB - nothing lights up when dragging
  2. This all works fine in beta 3 and earlier, so all I can figure is that there's some new requirement Xcode is now checking for that I'm sideways with but not in the obvious way
  3. I have the splitview set to horizontal in the storyboard, and it's being ignored by the interface builder in beta 4 & 5 (at least visually in the editor). I can't get a compile completed to see what happens at runtime.

I appreciate your taking a stab - any other ideas?

You have the 'view' propery of the NSSPlitViewController pointing to the splitview. This is no longer allowed.

So, right-click on the controller and remove the link between the 'view' and the 'splitview'. The view should point to nothing, it is not the splitview and includes e.g. the segmented-control.

It is a bit annoying, because this (letting the view point to the splitview) was the only way I know of to avoid DETECTED_MISSING_CONSTRAINTS warnings on _NSSplitViewItemViewWrapper. (This happens when you nest NSSplitViewControllers or combine them with NSTabViewController).

"It is a bit annoying, because this (letting the view point to the splitview) was the only way I know of to avoid DETECTED_MISSING_CONSTRAINTS warnings on _NSSplitViewItemViewWrapper. (This happens when you nest NSSplitViewControllers or combine them with NSTabViewController)."


Any luck finding a fix for this?