Reasons for an IBOutlet to be nil

前端 未结 6 1820
滥情空心
滥情空心 2021-01-12 13:44

What are the reasons why an IBOutlet (connected) could be nil?

I have one in may application which is always nil, even if I re

6条回答
  •  情话喂你
    2021-01-12 14:21

    If you've also defined a loadView method that creates the view, it is possible based on how you initialize it. If you initialize it using alloc-init and the nib name is not the same as class name, then you can have a case where the outlet is nil. But Chuck's answer seems more reasonable to assume.

提交回复
热议问题