如果我们从情节提要/ xib到ViewController / View创建许多IBOutlet,那么会导致性能开销吗?如果可以,怎么办?
是。这就是为什么您应该根据自己的目的创建许多情节提要的原因。例如:设置情节提要,主情节提要,用户情节提要,选取器情节提要。
请参阅Apple Developer中的IBOutlet
定义。
我们可以看到这个
the more outlets an object has, the more memory it takes up.
If there are other ways to obtain a reference to an object,
such as finding it through its index position in a matrix,
or through its inclusion as a function parameter,
or through use of a tag (an assigned numeric identifier),
you should do that instead.
因此会导致性能开销。
有关更多详细信息,请参见文档。