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)集'而不是一個數組。 –