0
我在这个问题上摸不着头脑。无法从Swift的collectionview中访问核心数据对象
我不断收到以下errror:
'NSInvalidArgumentException', reason: '-[_NSFaultingMutableSet objectAtIndex:]: unrecognized selector sent to instance
0x7ff3ec6b4590'
当我尝试从我的集合视图中访问照片核心数据模型。
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
var cell = collectionView.dequeueReusableCellWithReuseIdentifier("cell", forIndexPath: indexPath) as! PinViewCollectionViewCell
println(selectedPin!.attachedPhotos.count) // Returns 3
println(selectedPin!.attachedPhotos[indexPath.row])
//^^Returns NSInvalidArgumentException', reason: '-[_NSFaultingMutableSet objectAtIndex:]:
//unrecognized selector sent to instance 0x7ff3ec6b4590'
return cell
任何想法如何我可以访问附加的照片个别项目?
最有可能的'attachPhotos'是一个'(NS)集'而不是一个数组。 –