0

I have a string declared as var searchString = ""

I am trying to do parse query as shown below: query?.whereKey("username", containedIn: searchString)

What is the issue?

This is in Xcode 6.3 updated and also Swift 1.2.

enter image description here

user1406716
  • 9,565
  • 22
  • 96
  • 151

1 Answers1

1

The function expects an array of AnyObjects, you supply a String. Simply wrap the string in an array...

query?.whereKey("username", containedIn: [searchString])
Matthias Bauch
  • 89,811
  • 20
  • 225
  • 247
  • Oh thanks, you are right. Your second answer is right: `query?.whereKey("username", containedIn: [searchString])` – user1406716 Apr 26 '15 at 05:39
  • Any chance you may know the answer to this too?: http://stackoverflow.com/questions/29874414/cannot-subscript-a-value-of-anyobject-with-an-index-of-type-int – user1406716 Apr 26 '15 at 06:15