IBOutletCollection 未与 Storyboard 中的 UILabels 连接
IBOutletCollection not connected with UILabels in Storyboard
我有一个 IBoutletCollection
属性 连接到 Storyboard
中的几个 UILabels
:
@property (weak, nonatomic) IBOutletCollection(UILabel) NSArray *labels;
叫
NSLog(@"%ld",(long)self.labels.count)
在 viewDidLoad
之后
得到 0
作为结果。
我这里的 ivar 是空的,这是怎么回事?
Autolayout
有什么问题吗? (是的,我在 Storyboard
中使用它)
感谢任何建议!
将weak
更改为strong
@property (strong, nonatomic) IBOutletCollection(UILabel) NSArray *labels;
我有一个 IBoutletCollection
属性 连接到 Storyboard
中的几个 UILabels
:
@property (weak, nonatomic) IBOutletCollection(UILabel) NSArray *labels;
叫
NSLog(@"%ld",(long)self.labels.count)
在 viewDidLoad
得到 0
作为结果。
我这里的 ivar 是空的,这是怎么回事?
Autolayout
有什么问题吗? (是的,我在 Storyboard
中使用它)
感谢任何建议!
将weak
更改为strong
@property (strong, nonatomic) IBOutletCollection(UILabel) NSArray *labels;