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 回答