0

i get this error on:

        cell.naamItem = VragenInformatie[indexPath.section][indexPath.row][0]

i have this in the same class:

    var VragenInformatie: [[[String]]] = [[[]]]

and this is how the array looks like:

var VragenInformatie: [[[String]]] = [[["Spelletjeskamer",""],["Keuken",""],["Garage",""],["Binnenplaats",""],["Zitkamer",""],["Slaapkamer",""],["Studeerkamer",""],["Eetkamer",""],["Badkamer",""]],[["De Wit",""],["Pimpel",""],["Blaauw van Draet",""],["Roodhart",""],["Groenewoud",""],["Van Geelen",""]],[["Loden pijp",""],["Pistool",""],["Engelse sleutel",""],["Dolk",""],["Touw",""],["Kandelaar",""]]]

i don't really no what the problem is here neither do i know what subscript really means

could someone give some advise?

3
  • 1
    What is the error message? The result of the expression on the right side is a String. Is naamItem also a String? Commented Jan 27, 2016 at 20:50
  • Is cell.naamItem a String ? Commented Jan 27, 2016 at 20:55
  • That's a lot of [[[ & ]]]. LISP nostalgia? Commented Jan 27, 2016 at 21:33

1 Answer 1

1

I bet your naamItem is a UILabel or something like that, and you forgot to append the '.text'. If my theory is true, your code should look something like this:

cell.naamItem.text = VragenInformatie[indexPath.section][indexPath.row][0]

In any other case where the naamItem is NOT an UILabel, UITextView or UITextField, you should make sure the naamItem is of type String.

Sign up to request clarification or add additional context in comments.

Comments

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.