简体   繁体   中英

UICollectionView passed in collectionView:numberOfItemsInSection: is nil

I have a collection view in a uiviewcontroller using storyboard. View controller delegate methods are called but the collectionView argument is nil on variables view. I cannot use the view for anything, I can log it on console with NSLog but not with po. For example in

- (NSInteger)collectionView:(UICollectionView *)cv numberOfItemsInSection:(NSInteger)section

cv is nil on variables view. What could be the reason?

在此处输入图片说明

在此处输入图片说明

Are you sure you are not in "Release" mode?

If you want to debug your application, you'll need to be in "Debug mode".

To check, go to the top left near the start button and click on your project name. Then choose "Edit Scheme". On the "Info" tab, you should have your build configuration set to "Debug", not "Release".

If you are in "Release" mode, then stopping on breakpoints won't do you any good. Everything will appear nil.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM