Failed to connect (storyboard) outlet from (NSApplication) to (NSNibExternalObjectPlaceholder) error in Cocoa and storyboard

后端 未结 4 2094
南方客
南方客 2021-02-07 18:14

I\'ve tried to build a sample Cocoa app on which I want to connect UI components put on storyboard to ViewController.swift as either an IBOutlet or

4条回答
  •  面向向阳花
    2021-02-07 19:15

    I think I figured out the right solution.

    enter image description here

    1) Drag an Object into you xib interface.

    enter image description here

    2) Click the Object in the left list you just dragged in.

    enter image description here

    3) Bind the Object to your custom class.(Here my class is a login window controller as example)

    enter image description here

    4) Ctrl drag button to the source code. In the popup window, choose your class name(here in example is Login Window Controller) rather than File's Owner.

    Hope this could help you.

提交回复
热议问题