How to add the Document.xib file in XCode 8.3?

#1

Hi,

I followed the 4th Edition of this book with XCode 8.3, and after I check the “Create Document-Based Application” checkbox, I found “Document.h” and “Document.m” are created. But in the book it said and RMDocument.xib file will created for us, I cannot find this file in my project, and I don’t know how to create it and make connection between xib, h and m files.

Could anyone help me on this? Thanks!

#2

Can you see any XIB files? If so, what are they named?

Also, if storyboards are available in Xcode 8.3, you may have accidentally created a storyboard instead.

If you start out your project like this:


Then you will definitely get your Document.xib file

#3

Thanks for your reply!

I cannot see any xib file. I did create a storyboard, but in XCode 8.3, storyboard is the only option.

#4

#5

#6

Since there is no Document.xib, the document’s view is now managed by the ViewController. However, the way connections are made in interface builder is still the same.

To make the connections in interface builder, activate the connection-panel (an HUD view) for the ViewController. You should see something like this:

#7

I think Main.storyboard manages the ViewController.h/.m, there is nothing deal with the Document.h/.m, should I place an object in “View Controller Scene” and set its class to “Document” to expose the properties/functions to the ViewController? Thanks!

#8

In this example, I also found I cannot bind the Table View to a File’s Owner (aka. NSDocument), does this mean that it’s I have no way to use this Document object in the storyboard?

This chapter and XCode 8.3 confused me a lot:

  1. XCode 8.3 force me to create storyboard.
  2. This chapter ask me to create Document-based project.
  3. XCode 8.3 never create document.xib file for me even I create a Document-based project.
  4. Even I skip all the steps about document.xib, I still cannot bind the Table View to the File’s Owner (Document).

Could anyone help me a way out? Thanks!

#9

It seems I finally get things done by the way putting the document object in the View Controller Scene. Thanks for your help.