Xcode default cocoa bindings?

Hi, when I create a new XCode project (and in this case one that is a Document-Based App, should that matter), I see that there are some cocoa bindings already set.


For example:


File's Owner has an outlet that goes from window to Window.

File's Owner has a Referencing Outlet that goes from delegate to Window


Window has an Outlet that goes from delegate to File's Owner.

Window has a Referencing Outlet that goes from window to File's Owner.


If I were to break these connections in the utilities panel, how would I reset them? Asking for a friend who happened to break these connections and can't get them reconnected. Thanks!

Accepted Reply

Ah ha! Somehow my File's Owner had it's class set to NSApplication, but it needs to be set to "Document." This allows the "window" pop up to exist when ctrl-dragging from File's Owner to Window. So the defaults are ctrl-dragging from File's Owner to Window and selecting window in the pop-up, and then ctrl-dragging from Window to File's Owner and choosing "delegate" from the pop-up.


Thanks guys!!!! Y'all really knocked it out of the park this time!

Replies

I have figured one of them out.


If you control drag from Window in IB Dock to File's Owner right above it, you will set:


File's Owner will have a Referencing outlet from delegate to Window

Window will have an Outlet from delegate to File's Owner


So items 2 and 3 above can be set this way. I'd love to know how to set 1 and 4. Thanks

I think I'm supposed to be able to control-drag from File's Owner to Window, and a "window" option should appear in the pop-up, but the only option I get is "delegate" even though my Window is an NSWindow object. I can control-drag from Application to Window and get the magical "window - Window" relationship, but not from File's Owner. Hmm....

Ah ha! Somehow my File's Owner had it's class set to NSApplication, but it needs to be set to "Document." This allows the "window" pop up to exist when ctrl-dragging from File's Owner to Window. So the defaults are ctrl-dragging from File's Owner to Window and selecting window in the pop-up, and then ctrl-dragging from Window to File's Owner and choosing "delegate" from the pop-up.


Thanks guys!!!! Y'all really knocked it out of the park this time!