mercredi 4 mars 2015

swift NSPredicate compare string

In the twitter api, the id_str is like this: "572581876033982465". Right now I want to use NSPredicate to filter the tweets, and the current format is like NSPredicate(format: "idStr > %@", self.maxId!). both idStr and self.maxId is String type. And it crashes with message: "Operator type 2 not supported for string type". I think it means I should cast both of them to number value. But How to cast the id_str in the format?




Aucun commentaire:

Enregistrer un commentaire