Xcode Interface Builder - “correct” way to delete/rename miswired IBoutlets / IBactions

前端 未结 3 852
名媛妹妹
名媛妹妹 2020-12-01 01:06

I am new to Xcode, working through Swift, so I\'m not sure if what I am decribing is actually a bug.

When using interface builder and the assistant editor, I can cre

相关标签:
3条回答
  • 2020-12-01 02:01

    You can find unused IBOutlets in the file in which they're declared by looking in the "gutter" of the source editor for an "unfilled hole".

    0 讨论(0)
  • 2020-12-01 02:03

    Use the Connections inspector to break the connection. Then you can modify/delete the object and/or the code without having to worry.

    enter image description here

    0 讨论(0)
  • 2020-12-01 02:10

    The accepted answer is fine, but there are a few ways to do the same thing.

    Method One

    Right click the view in the storyboard and then click the little x by the referencing outlet.

    Method Two

    Right click the view name in the Document Outline. Then click the little x by the referencing outlet.

    Method Three

    Select the view on the storyboard and then click the Connections Inspector. Then you can click the little x to remove an outlet reference.

    Extra References in Code

    If you are getting outlet connections in code that you didn't add yourself see this answer.

    0 讨论(0)
提交回复
热议问题