Interface Builder won't allow connections to custom UIView class?

前端 未结 5 1740
野的像风
野的像风 2021-01-02 09:44

Using Xcode 4.3.3, I can\'t figure out how to connect outlets in a custom UIView class with objects created in Interface Builder.

In one ViewController, I have a var

5条回答
  •  萌比男神i
    2021-01-02 10:01

    I opened a bug with Apple. If anything interesting happens, I'll update this answer.

    Updated 10/4/13: After much research, it seems the root of the problem is that IB believes that I'm trying to connect objects to properties within a class, that I'm going to then create a swarm of instances of this class and then IB won't be able to tell which instance should handle the messages. So, it disallows the connection on the belief that I'm (potentially) making simultaneous connections from one object to multiple copies of a property across several instances of the class.

    My view is that I only want a single instance of the custom UIView, and that I should be able to tell IB, "don't panic, you're only dealing with this one instance."

    I'm now focused on a new project and haven't had a chance to retry this in Xcode 5; however, given the info above, I'm not optimistic it will work in Xcode 5, either.

提交回复
热议问题