0

I am having problems attempting to return elements of a String array line by line within a textView. I have indeed used the special carriage return character in my code sequence to return elements of the array on separate lines. However, I have not been able to succeed thus far. Here is a code snippet of what I typed:

txtViewQuestionStatus.text = "\(numCorrect) correct Answers, However these are the questions answered INCORRECTLY: \(model.incorrectItems())\n" //Have text view present number of correct answers and list incorrect Questions line by line.

What could I be doing wrong in my source code? Thanks!

1 Answer 1

2

What is model.incorrectItems() returning? Can you post that part of your code? If it returns an array of strings you can join them like so:

"... INCORRECTLY: \(model.incorrectItems().joinWithSeparator("\n"))\n"
Sign up to request clarification or add additional context in comments.

1 Comment

That's exactly it, thank you very much Stijn van der Laan.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.