user1406716
user1406716

Reputation: 9705

String not convertible to [AnyObject]

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

Upvotes: 0

Views: 517

Answers (1)

Matthias Bauch
Matthias Bauch

Reputation: 90127

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

query?.whereKey("username", containedIn: [searchString])

Upvotes: 1

Related Questions