PSTCollectionview对我不起作用?

Nav*_*een 0 objective-c collectionview ios pstcollectionview

我有一个故事板项目,我添加了PSTCollectionview类和所有文件.然后我为我的viewcontroller创建了一个类"allbooks.h,.m in"PSUICollectionviewcontroller_"并且iam无法在我的viewcontroller上添加这个类???

GMMAllBooksGrid.h

#import <UIKit/UIKit.h>

@interface GMMAllBooksGrid : PSUICollectionViewController
@end
Run Code Online (Sandbox Code Playgroud)

Ani*_*ese 6

您可以像使用UICollectionView一样使用PSTCollectionView.我会发布我的代码可能对你有帮助.

CollectionViewController.h

#import <UIKit/UIKit.h>
#import "PSTCollectionView.h"


@interface CollectionViewController : UIViewController <PSUICollectionViewDataSource,PSUICollectionViewDelegate,PSUICollectionViewDelegateFlowLayout>

@property(nonatomic,retain) PSUICollectionView *collectionView;
@end  
Run Code Online (Sandbox Code Playgroud)

CollectionViewController.m

-(void)loadView
{
[super loadView];
self.view.backgroundColor = [UIColor whiteColor];
PSUICollectionViewFlowLayout *layout = [[PSUICollectionViewFlowLayout alloc] init];

// Configure layout attributes globally
layout.itemSize = CGSizeMake(150, 150);

self.collectionView = [[[PSUICollectionView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds)) collectionViewLayout:layout]autorelease];
[self.collectionView setDelegate:self];
[self.collectionView setDataSource:self];
[self.collectionView setAutoresizingMask:UIViewAutoresizingFlexibleHeight |UIViewAutoresizingFlexibleWidth| UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin];
[self.collectionView setBackgroundColor:[UIColor clearColor]];

// Register Cell and supplimentary views
[self.collectionView registerClass:[PSUICollectionViewCell class] forCellWithReuseIdentifier:CELL_ID];



[self.view addSubview:_collectionView];
}
Run Code Online (Sandbox Code Playgroud)