Error: Cannot use instance member within property initializer - Swift 3

前端 未结 1 556
慢半拍i
慢半拍i 2021-01-18 17:27

When I compile the following code I get an error \"Cannot use instance member \'AddEployeeName\' within property initializer, property initializers run before \'self\'is ava

1条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-18 17:55

    You can't call addEmployeeName.text! within property initializers. You can however initialize 'employee' within a method like viewDidLoad

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