0

I'm trying to create outlets using the Interface Builder, however when drag the UILabel from the IB to my controller's .h file the big lock symbol flashes for a few seconds and it doesn't actually create the bind between the UILabel and the outlet (although the code is generated). I also noticed an empty circle is created by this new definition. When it worked, a filled in circle was created on the side).

I've checked the UILabel and all parent views and have checked that their "Lock" property is set to "Inherit (Nothing)" (and have even set them all to "Nothing").

In the IB the UILabel doesn't show the "x" that appear when a UILabel is locked either.

So I have no idea if I'm missing to unlock something, or what I'm doing wrong to be able to create this outlet.

I don't know if this is relevant, but I'm using a custom view controller, and I'm using this same view controller subclass for 2 different view controllers in the same storyboard. I had no problems creating outlets this way for the first view controller.

Tryed reopening XCode (using 4.4.1) with no luck.

Any help is appreciated!

4

2 回答 2

0

那么您是否将两个 UILabel 从每个 View Controller 拖到同一个文件中?我认为这是不可能的,在第二个视图控制器上,尝试 Ctrl 拖动到 IB 视图内的文件所有者,即假设两个视图都连接到同一个实例。此外,在故事板的身份选项卡中,在 Localization Locked 下,确保您的故事板锁定设置设置为默认值,如https://stackoverflow.com/a/11169636/720175中所述

于 2013-05-16T01:06:54.183 回答
0

我尝试添加一个全新的场景,也会得到锁符号。所以不仅仅是场景,而是整个故事板。所以快速搜索 SO 让我得到答案:

https://stackoverflow.com/a/11169636/720175

于 2013-05-16T14:48:11.140 回答