2016-03-12 37 views
-1

我有問題試圖在textView中逐行返回字符串數組的元素。我確實在我的代碼序列中使用了特殊的回車符來將數組的元素返回到不同的行上。但是,迄今爲止我還沒能成功。下面是我鍵入的代碼片段:如何加入字符串數組?

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. 

我的源代碼中有什麼可以做錯的?謝謝!

回答

1

什麼是model.incorrectItems()返回?你可以發佈你的代碼的一部分?如果它返回一串字符串,您可以像這樣加入它們:

"... INCORRECTLY: \(model.incorrectItems().joinWithSeparator("\n"))\n" 
+0

就是這樣,非常感謝Stijn van der Laan。 – Linuxn00b

相關問題