All the IBOutles
are initialized properly and have values, but when I press a button in my navigation bar all my IBOutlets
are nil
inside that IBAction
. Setting a didSet
didn't help, so I couldn't figure out when the values become nil
as well as cleaning the project.
Asked
Active
Viewed 98 times
0

lysov
- 160
- 2
- 14
-
what error display – Berlin Aug 31 '17 at 06:07
-
@Jaydip unexpectedly found nil while unwrapping an Optional value – lysov Aug 31 '17 at 06:23
-
`IBAction` itself won't nil out `IBOutlets`. I don't see any problems with above codes. Check if your `doneButton` is wired with some behavior in your storyboard. – sCha Aug 31 '17 at 06:25
-
1Are those two screen snapshots a result of one debugging session? I ask because if you notice, `self` refers to two different `FacebookRegistrationVC` instances. I wondering if you accidentally have an incurrence of `FacebookRegistrationVC()` somewhere in your code which, rather than referring to the storyboard-instantiated VC, is creating a second instance not linked to any storyboard scene. You can confirm this by hitting the "Debug memory graph" button (see https://stackoverflow.com/a/30993476/1271826) and see how many `FacebookRegistrationVC` instances you see in the list on the left. – Rob Aug 31 '17 at 06:43
1 Answers
0
First this is textFied right, then you can didset textfield text not print because print value in console, it's not set In your textField bro.
so, you can write like
@IBOutlet weak var emailTextField: AuthenticationTextField!{
didSet{
emailTextField.text = "changed"
}
}

Berlin
- 2,115
- 2
- 16
- 28