0

In my collectionView based app i want to cache the last 100 cells loaded, and i think best way for me is to work with core data. I already have a custom class for UICollectionViewCell, and obviously all the cells are objects of this class. it's look kind of like this:

@interface Cell : UICollectionViewCell

@property (strong, nonatomic) NSString *cellFacebookId;
@property (strong, nonatomic) NSString *cellMail;
@property (strong, nonatomic) NSString *cellAddId;
@property (strong, nonatomic) NSString *cellCategory;
@property (strong, nonatomic) IBOutlet UIImageView *cellBackImg;
@property (strong, nonatomic) IBOutlet UIImageView *titleBarImage;

@end

Now I've created an entity named Cell, with same attributes. can i create a NSManagedObject subclass that will replace my original "Cell" class and still use it as UICollectionViewCell custom class?

4

1 回答 1

2

您不能将 NSManagedObject 的子类用作 UICollectionView 单元格。它必须是 UICollectionViewCell 的子类。除了 UICollectionView 通过缓存它们来重用单元格。

于 2013-05-13T17:38:53.273 回答