с последним релизом Xcode (GM) Я имею много ошибок строит свой проект, который с предыдущей версией не было замечено как следующего кодXcode 6 GM - NSFetchedResultsSectionInfo
override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
let sectionInfo = self.fetchedResultsController.sections[section] as NSFetchedResultsSectionInfo
println("numberOfRowsInSection: \(self.entityName()) : \(sectionInfo.numberOfObjects)")
return sectionInfo.numberOfObjects
}
Я переписать следующий :
override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
//#warning Incomplete method implementation -- Return the number of items in the section
if let sectionInfo = fetchedResultsController.sections {
println("numberOfRowsInSection: \(self.entityName()) : \(sectionInfo[section].numberOfObjects)")
return sectionInfo[section].numberOfObjects
}
return 0
}
есть ли лучший и правильный способ написать это?
NSFetchedResultsSectionInfo - это протокол, а не класс. – quellish