-1

This freaks out because it finds an unexpected " in the string interpolation:

let temp = "\(catalogueRows[0]["person"])"

Tried using single quotes but that didn't work. Seems like a pretty simple step and I'm confused why it doesn't work.

Tom
  • 917
  • 2
  • 12
  • 23
  • It doesn't "freak out". _You_ "freak out", perhaps. But you shouldn't. If you can't accept that computer languages have syntax rules, don't program. – matt Dec 13 '14 at 16:12

1 Answers1

2

You can't use quotes in a string interpolation. That's just the way the syntax is.

You can't "escape" or single-quote your way out. You'll need two lines of code to do what you're trying to do:

let temptemp = catalogueRows[0]["person"]
let temp = "\(temptemp)"
matt
  • 515,959
  • 87
  • 875
  • 1,141