Jtapplecalendar: Cells not showing

Created on 2 Jul 2016  ·  13Comments  ·  Source: patchthecode/JTAppleCalendar

Sorry to be vague, I wouldn't usually ask a question unless I'm really stuck - in which I am. I've tried to debug this, but I'm at a dead end.

The problem is that the cells are just not showing in the calendar - I presume this as I've tried playing with the colours and adding new UI elements to the cell, but nothing is showing. I've checked for layout errors, colouring, etc.. and I can't seem to track down what the issue actually is. I've re-read the tutorial now several times, but cannot seem to see where I have gone wrong.

Please help! :(

Edit project removed

example_cal_no_cells

question

All 13 comments

You have an Xcode bug. I assume its an XCodeBug because your problem views on your storyboard are displaying in a weird way on my screen. I can only find them on the view. Can you even find them? I couldn't.

Steps to fix:
1) Do a pod install to get the latest version of JTAppleCalendar. Latest version is now 4.1.0
2) Your Xcode is bugged. in 2 places

  • In your main.Storyboard, on your >> DaysViewController << delete all your views in there and redo them. Reconnect them, everything
  • In your DateCellView.xib, delete all your views and redo them, Reconnect them. everything

Your code will be fixed when you do these 2 things.
I have done this for you. Here is your fixed file --> TimeCard.zip

Compare it with your local file and see the weirdness that's going on in your story board.

Thank you so much, you version does indeed work, although I cannot get my version to work at all, despite following the steps to fix several times.

1) I've updated to the latest version of JTAppleCalendar by running pod update.
2) I've removed all views/classes/files, pretty much started those sections from scratch and it's still not working. Although, whats interesting is that the cell is _there_ in the sense that if you click around on the calendar view, its registering the tap event as its logging the NSIndexPath.

Although, after running a a diff check in FileMerge, I cannot figure out why my project is generating vastly different xml for the storyboard. Your's generates very little in the way of constraints and position information, whereas mine generates a significant amount more.

Any ideas?

I appreciate your help, I'm still very much a beginner with Swift and Xcode, although working with other languages. So please excuse my ineptitude, it annoys me as much as it annoys you - I hate not understanding and would much rather learn from these things as to why they error.

I think I might just start the project again from scratch. It won't take too long to rebuild and will give the project a clear out. I'll make sure to implement the Pods first, get that working, then the rest of the app can follow.

You dont have to replace every thing. Just the places where you have the weird issue. Here is your bugged file ->
screen shot 2016-07-02 at 10 04 33 am

You can see that in

  1. You correctly have your main view
  2. But in 2, the calendarView looks like a ghosted out color. In does not look like a vivid color like your main view. And when you click on it, you cannot even find it on the canvas in arrow # 5.

Also, you have 2 other ghosted out color views # 2, and # 3. I have no clue what these are. Delete them and recreate them. The same ghosted color can be seen in your cellXib file for your label. Remove it and recreate it. Here is what your corrected Interface builder supposed to look like:

screen shot 2016-07-02 at 10 00 16 am

You can clearly see:

  1. A main view
  2. Followed by a non-ghosted colored CalendarView

Also you can clearly see the CalendarView on the canvas (i put it in gray color)

Closing this issue. Have a good one. If you have any other issues let em know.

Thank you so much for going out of your way and providing a very detailed answer, I appreciate it. :)

I did try what you outlined above, but it still didn't solve it for me. Ah well, I'll just start the project again, get any weirdness out that was bugged in. Thanks again. :)

Cheers man ^^ 👍

I'm really sorry to be a pain, but I've rebuilt the project from scratch. No copying anything across, but the same design layout - but all rebuilt from a new project.

I'm finally at the point that I was at in the previous app, but I have refrained implementing anything until I could get the calendar working. I've just implemented the calendar again and I have the exact same issue as I had originally.

What the hell am I doing wrong?! I'm starting to get angry at myself for not understanding what is going wrong, please find attached the new app. If you don't want to look, that's fine. I'll start from scratch again and see if I can peg down what exactly the issue is.

Usually I have a lot of patients for this sort of thing, but I've been at it now for 2 days and because I have a lack of understanding of Xcode's/Swifts core mechanics, I really don't know where to start in terms of debugging. Maybe that should be my first port of call, an online course. Although I usually learn best by implementing an idea that I am enthusiastic about. I don't know, I just feel out of my depth for something I think is slap bang in front of my face. I need to goto bed, fresh head and all.

timecardnew.zip

Take a look at your main.storyboard. You have the same ghosted colored views.

screen shot 2016-07-02 at 6 56 55 pm

So:

  1. What version of XCode are you using?
  2. Are you able to SEE you view on the storyboard? (because i can't)
  3. How are you creating these views?

Basically, you have the same ghost view erros as in the last project.

Here is how i fixed it. Have a good one.
Untitled.mov.zip

Thank you so much for this, I really do appreciate the help a lot.

  1. 7.3.1 (7D1014)
  2. Yes. They appear as normal views for me, not ghosted:

screen shot 2016-07-03 at 11 21 09

which is why I'm not understanding why they are appearing fine for me, but not for you. (background colours for illustrative purposes)

  1. Simply dragging a new UIView onto the parent view in the storyboard, then applying auto layout constraints for positioning, exactly the same as you do in the video (amazing by the way, thank you).

[5 minutes passed]

So I tried your steps in the video and it's still not working. BUT, I had a brain wave. I change the IB's size class at the bottom to make it easier to edit, which after searching SO (here and here for example) turns out that this is why the views are ghosted and why the views aren't appearing. When I send the project to you, the size classes reset - which is why they are appearing ghosted for you.

screen shot 2016-07-03 at 11 43 06

So after setting the labels view property to be displayed on installed, instead of depending on the device, it works fine. Right at the bottom on here:

screen shot 2016-07-03 at 11 43 20

changed to this:

screen shot 2016-07-03 at 11 43 38

I just feel out of my depth for something I think is slap bang in front of my face.

I feel like a fool and such a simple question to Google: 'xcode ghosted views'. Oh well, fresh head and all.

Thank you so much for you help, you went above and beyond to help me out on this, I really do appreciate it. If you ever require any help with web stuff, I'm a full stack dev by trade, so I could help you out with that in return.

Thanks again & sorry for the inconvenience! 👍

Interesting. I learned something too haha.

And thanks. Have a good one. Just another question, what web programming language do you work in?

Haha, the least I could do.

Apache as the web server, PHP for backend (Codeigniter/Larvel frameworks), MySQL DB, standard markup/JS for frontend. Usually just run an LAMP stack on an ubuntu server box for the host, gets all the above deployed very quickly, only have to run through a very security hardening actions and its good to go.

Currently looking into Nginx as a webserver as well (each have their own benefits) and React as a new JS based backend, just to broaden my skill set, although I really don't like JS as a language. Find it messy and loose. Although there are alternatives to MySQL that can provide performance benefits, I find it to be solid.

I also dabble in PHP laravel (homestead) with MySQL. Good to know. I'm weak on front end though. Cool man, thanks for the info. Good to know for future reference. Thanks.

Was this page helpful?
0 / 5 - 0 ratings