Reputation: 25
I dont know how I can use this:
"\(something)"
With this:
"\(otherthing)"
Like that:
botaoA.setTitle("\(myAnswers[myQuestions.indexOfObject("\(myQuestions.new)")][0])", forState: UIControlState.Normal)
But the quotation marks not works corretly..
Upvotes: 1
Views: 43
Reputation: 392
The answer by Avt is very correct, but the code is not great to read. My suggestion is that you should separate the elements of your code:
let questionIndex = myQuestions.indexOfObject("\(myQuestions.new)")
let selectedAnswer = myAnswers[questionIndex][0]
botaoA.setTitle(selectedAnswer, forState: UIControlState.Normal)
Upvotes: 2
Reputation: 17043
Difficult to guess but I think you need
botaoA.setTitle("\(myAnswers[myQuestions.indexOfObject(myQuestions.new)][0])", forState: UIControlState.Normal)
Upvotes: 0