This error always show when I try to retrieve and append the elements of an array in Parse to an array created in the code:
Could not cast value of type '__NSArrayM' (0x10b281b60) to 'NSString' (0x10bdc5b48).
However, when I use print, it works with no errors and I can get the data
var query = PFQuery(className: "Courses")
query.whereKey("subject", equalTo: "\((object["course"] as! String))")
query.findObjectsInBackgroundWithBlock { (objects, error) in
if let objects = objects
{
for object in objects
{
print(object["subject"] as! String)
self.courses.append(object["subject"] as! String)
print(object.valueForKey("timeToShow")!)
// it works to print the elemnts in array from parse self.dates.append((object.valueForKey("timeToShow") as! String))
// this line shows the error down !
self.tableView.reloadData()
}
}