JTAppleCalendar icon indicating copy to clipboard operation
JTAppleCalendar copied to clipboard

Bad Exec Error...

Open cbwilliamsnh opened this issue 10 years ago • 10 comments

I'm getting a EXC_BAD_ACCESS error when trying to set the delegate to my controller

I also don't see JTAppleCalendar as one of the choices on the Class Inspector. I see the classes in the attached screenshot.

Am I doing something wrong? Using latest Xcode. screenshot 2016-05-23 18 15 27

Here's a screen shot of the error:

screenshot 2016-05-23 18 23 16

cbwilliamsnh avatar May 23 '16 22:05 cbwilliamsnh

Oddly enough, when I implement my code as in the example (with the calendar delegates in an extension) it works.

Why would it not work with the view controller directly implementing the delegate classes for the calendar?

cbwilliamsnh avatar May 23 '16 22:05 cbwilliamsnh

Ok, i am trying to understand your problem.

I just took the same project attached here on github. I removed the extension and set everything up in the ViewController like so:

class ViewController: UIViewController, JTAppleCalendarViewDataSource, JTAppleCalendarViewDelegate {
...
}

Then i moved all the functions that was in the extension, into the viewController just like you did. And when i run the app, it works. So try and help me understand where your problem is:

  1. What version of the framework are you using?
  2. Are you installing it using cocoapods? or something else.

If you are using the latest version and you are using cocoapods to install the calendar. Then...

  1. did you look at the quick tutorial on how to set it up?

You have correctly imported JTAppleCalendar in your viewController class. But, on your interface builder file (as shown in the tutorial), your calendarView should be a subclass of JTAppleCalendarView

patchthecode avatar May 24 '16 02:05 patchthecode

Here's what I did.

  • installed using cocoapods
  • followed the tutorial in the documentation
  • had everything in my view controller class (did not use an extension)
  • I thought I had all the class types properly set

Crashed as shown in screens.

Changed the source/delegate to be in an extension exactly as in the tutorial. Everything worked. Chuck

cbwilliamsnh avatar May 24 '16 02:05 cbwilliamsnh

I just did what you said. And it works. So here's what, can you upload a bugged copy of your project on github so that i can take a look?

patchthecode avatar May 24 '16 02:05 patchthecode

I can do that tomorrow.

Chuck

cbwilliamsnh avatar May 24 '16 02:05 cbwilliamsnh

Alright. I will appreciate it. Thanks. Upload it once you are able to do so

patchthecode avatar May 24 '16 03:05 patchthecode

Ok, now it works without the extension, so I can only conclude that I was doing something else wrong.

Chuck

On Mon, May 23, 2016 at 11:01 PM, JTAppleCalendar [email protected] wrote:

Alright. I will appreciate it. Thanks. Upload it once you are able to do so

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/patchthecode/JTAppleCalendar/issues/23#issuecomment-221154413

Chuck

cbwilliamsnh avatar May 24 '16 10:05 cbwilliamsnh

Ok thanks. Closing this issue. Have a good one

patchthecode avatar May 24 '16 11:05 patchthecode

I got the same thread error at runtime. I followed the tutorial and did not get any errors until testing.

yillivs avatar Jul 03 '16 20:07 yillivs

@yillivs Ok first, create a new issue.

Then can you upload a copy of your bugged project there? I want to take a look at it And can you tell me which part of the code you are experiencing the problem? Do this on the newly created issue

patchthecode avatar Jul 03 '16 23:07 patchthecode