cuốn sách gpt4 ai đã làm

iphone - - (UICollectionViewCell*)collectionView :(UICollectionView*)collectionView cellForItemAtIndexPath not called

In lại Tác giả: Walker 123 更新时间:2023-11-28 22:46:15 42 4
mua khóa gpt4 Nike

我有这两个代表:

#pragma mark = UICollectionViewDataSource

- (NSInteger)collectionView:(UICollectionView*)collectionView numberOfItemsInSection:(NSInteger)section
{
NSLog(@"COUNT IS %d", [[AHImageDataSource sharedDataSource] count]);
return [[AHImageDataSource sharedDataSource] count];
}

- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView*)collectionView
{
trả về 1;
}

numberOfItemsInSection 返回 12。但未调用 cellForItem。当我只是对 numberOfItemsInSection 进行硬编码时,它实际上正在被调用。知道为什么会出现这个奇怪的问题吗?

đây là một sample project证明问题

câu trả lời hay nhất

nếu như [[AHImageDataSource sharedDataSource] count] trở lại không,则不会调用 cellForItemAtIndexPath。所以请确保 [[AHImageDataSource sharedDataSource] count] 有一定的值(value)。

我无法下载您的示例项目,所以帮不上什么忙。 :(

关于iphone - - (UICollectionViewCell*)collectionView :(UICollectionView*)collectionView cellForItemAtIndexPath not called,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13152351/

42 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress