Class has no initializers Swift

后端 未结 7 1343
迷失自我
迷失自我 2020-11-28 22:17

I have a problem with Swift class. I have a swift file for UITableViewController class and UITableViewCell class. My problem is the UITableViewCell class, and outlets. This

7条回答
  •  一个人的身影
    2020-11-28 22:41

    This is from Apple doc

    Classes and structures must set all of their stored properties to an appropriate initial value by the time an instance of that class or structure is created. Stored properties cannot be left in an indeterminate state.

    You get the error message Class "HomeCell" has no initializers because your variables is in an indeterminate state. Either you create initializers or you make them optional types, using ! or ?

提交回复
热议问题