Is passing two nil paramters to initWithNibName:bundle: method bad practice (i.e. unsafe or slower)?

后端 未结 1 390
慢半拍i
慢半拍i 2021-01-07 11:19

According to a comment in UIViewController regarding initWithNibName:bundle:

If you invoke this method with a nil nib name, then this

相关标签:
1条回答
  • 2021-01-07 11:50

    It's not unsafe or slow. It just means that there will be an extra check to see that the NIB with the same name as your class really exists in the bundle, then it will be loaded exactly as if you had passed the NIB name. It won't cause problems unless you decide to change how you name your NIBs. In face, there's a whole discussion about how -initWithNibName:bundle: is a bad initializer, and just using -init is better.

    0 讨论(0)
提交回复
热议问题