0

Im following a tutorial that connects to the web to fetch data and puts it into core data. Ive set up my UICollectionView with a cell with its identifier but when i run the project i get this in the console:

2013-06-23 20:26:17.051 UICollectionView[912:c07] Unknown class MyCell in Interface Builder file. 2013-06-23 20:26:17.055 UICollectionView[912:c07] CoreData: error: Serious application error. An exception was caught from the delegate of NSFetchedResultsController during a call to -controllerDidChangeContent:. [ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key cellLabel. with userInfo { NSTargetObjectUserInfoKey = ">"; NSUnknownUserInfoKey = cellLabel; }

ANd nothing but a blank (black) UICollectionView. I did subclass UICollectionViewCell and called it MyCell and I did declare and connect a image view IBOutlet as well as a UILabel outlet called cellLabel.

I eliminated the cellLabel outlet and just left my UIImageview but then I get the error with UIImageview.

I just found an interesting bit, I compared the tutorial code with mine but its identical. Then I compared the MasterViewController outlets, connections and identities and found this difference. Their custom cell called AFCollectionViewCell is:

Tutorial's CollectionViewCell

but my custom cell "MyCell" is what it should be:

MyCell

Why on earth would theirs be a UITabBarController? That doesn't even make sense. But then in the Identity Inspector they are both what they should be, subclasses of the respective custom cell classes. Could this be a bug?

4

1 に答える 1

0

その修正...xcode5でプロジェクトを作成したときに何かが起こりました。ターゲット メンバーシップを .m ファイルに割り当てていませんでした。ターゲット メンバーシップをクリックしてチェックボックスをオンにすると、コード カラーリングが再び機能し、正常にコンパイルされるようになりました。

于 2013-06-24T17:55:52.570 に答える