简体   繁体   中英

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.

在此处输入图片说明

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM