Jtapplecalendar: Unrecognized Selector error: collectionView:numberOfItemsInSection

Created on 5 Dec 2017  路  15Comments  路  Source: patchthecode/JTAppleCalendar

Using build 7.1.4

Simply set up like in the tutorial and I get the above error when I try to display the view. Any ideas?

Awaiting User Input question

Most helpful comment

Yep, it was my fault completely. I had two common issues:

  • Not setting the Module of the UICollectionView to JTAppleCalendar
  • Incorrectly connecting the DataSource and Delegate instead of the ibCalendarDataSource and the ibCalendarDelegate

I have corrected both of those and now it works perfectly. Thank you for creating such an amazing library!

All 15 comments

what command are oy running to get this error?
In which file is the rror happening?
Are you creating your app with code/interface builder?

I'll need more information to help you.

Thank you for your quick reply. I have figured out the listed problem (the Module for the the JTAppleCalendarView in IB was not being set properly.)

Now I have another interesting problem. Although I have set the calendar data source and delegate to my class in IB, and have set the extensions properly in my class, neither the ConfigureCalendar call or the cellForItemAtDate call are ever recognized. i have set break points in both and they are never called. Its as if Xcode never sees the extensions. I have tried to add this to the class and just setting the class to

import JTAppleCalendar

class ScheduleViewController: UIViewController, JTAppleCalendarViewDelegate, JTAppleCalendarViewDataSource {

but that doesn鈥檛 seem to work either.

I had all of this working fine in version 6.x but moving to version 7.x has been weirdly problematic,

OK I have figured out what the problem was. I was setting datasource and delegate to my class when I guess I needed to set calendarDataSource and calendarDelegate to my class.

Have you taken a look at all the tutorial videos? HERE

assuming resolved. closing issue.
If you have any further question, just ask.

I watched the video and followed each step and I get the same error. I also had to add the method "willDisplay" as a requirement.

@dadixon Have you tried doing what this user did to resolve this error?

Yes. I solved it by restarting XCode 3 times. Now when I connected the ibCalendarDataSource it worked fine.

@dadixon awesome. seems like an XCode issue then

I have the same issue

there's a sample project connected to the github. Download it and see what went wrong in your code

I too have this issue :/

There is a sample github project attached to this library.
Can you check it and see where your code is different?

Yep, it was my fault completely. I had two common issues:

  • Not setting the Module of the UICollectionView to JTAppleCalendar
  • Incorrectly connecting the DataSource and Delegate instead of the ibCalendarDataSource and the ibCalendarDelegate

I have corrected both of those and now it works perfectly. Thank you for creating such an amazing library!

Cool. Awesome. Have a good one.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dimitris-c picture dimitris-c  路  5Comments

dbmrq picture dbmrq  路  5Comments

nikolalukovic picture nikolalukovic  路  4Comments

Geekbell picture Geekbell  路  4Comments

Fatalution picture Fatalution  路  3Comments