fatal error: unexpectedly found nil while unwrapping an Optional value(When adding to a array)
问题 I have some code that receives value from a segue and replaces a certain element of an array with the index number that I have. The initialization of the variables is: var noteTitles: [String] = ["Sample Note"] var noteBodies: [String] = ["This is what lies within"] var selectedNoteIndex: Int! var newTitle: String! var newBody: String! and I have a segue that makes the last 3 values the values that I want them to be. under viewDidLoad(), I have this: if newTitle == nil && newBody == nil { }