Не удается преобразовать значение типа «NSIndexPath» в ожидаемый тип аргумента «NSIndexPath».
Ошибка self.collectionView?.moveItemAtIndexPath(obj[0] as! NSIndexPath, toIndexPath: obj[1] as! NSIndexPath) line
if let changes = self.objectChanges{
self.collectionView?.performBatchUpdates({ () -> Void in
for change in changes as NSArray as! [NSDictionary] {
change.enumerateKeysAndObjectsUsingBlock { (keyObject:AnyObject!, obj:AnyObject!, stop) -> Void in
let key = keyObject as! NSNumber
let type = NSFetchedResultsChangeType(rawValue: key.unsignedLongValue)!
switch (type)
{
case .Insert:
self.collectionView?.insertItemsAtIndexPaths(obj as! ([NSIndexPath]))
case .Delete:
self.collectionView?.deleteItemsAtIndexPaths(obj as! ([NSIndexPath]))
case .Update:
self.collectionView?.reloadItemsAtIndexPaths(obj as! ([NSIndexPath]))
case .Move:
self.collectionView?.moveItemAtIndexPath(obj[0] as! NSIndexPath, toIndexPath: obj[1] as! NSIndexPath)
default:
break
}
}
}
}, completion: nil)
}
for change in changes as NSArray as! [NSDictionary]
- что произойдет, если вы возьмете его в скобки, чтобы убедиться, что приведения происходят так, как вы ожидаете? - person Grimxn   schedule 28.09.2015