我有setPaginationEnabled(boolean paginationEnabled);
作为UIRefreshControl
的子视图。我的问题是我在viewController被释放后调用了我作为refreshControl目标添加的选择器。以下是我设置refreshControl的方法。
UICollectionView
在dealloc中,我试图说出这个:
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(refreshMedia:) forControlEvents:UIControlEventValueChanged];
[self.collectionView addSubview:refreshControl];
refreshControl.tintColor = [UIColor grayColor];
self.refreshControl = refreshControl;
[self.collectionView setBounces:YES];
self.collectionView.alwaysBounceVertical = YES;
这是我的错误信息:
-(void)dealloc{
self.collectionView.delegate = nil;
self.collectionView.dataSource = nil;
[self.refreshControl endRefreshing];
[self.refreshControl removeTarget:self action:NULL forControlEvents:UIControlEventValueChanged];
self.refreshControl = nil;
}