Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visibleDates call after reloadData with comletionHandler error #277

Closed
Tsarfolk opened this issue Jan 31, 2017 · 4 comments
Closed

visibleDates call after reloadData with comletionHandler error #277

Tsarfolk opened this issue Jan 31, 2017 · 4 comments

Comments

@Tsarfolk
Copy link

Tsarfolk commented Jan 31, 2017

I'm using 6.1.2 version of JTAppleCalendar

The problem:
I'm using something like this in viewDidLoad()

loadDataFromServer {
        self.calendar.reloadData() {
                self.calendarView.visibleDates { (visibleDates: DateSegmentInfo) in
                    .....
                }
        }
}

This line of code crashes the app. It worth to mention I was on swift 3.0 and there was no problem, then I updated it to 3.0.2 and JTCalendar too. Since then I got this crash. I attach images of that crash
2017-01-31 14 21 05
2017-01-31 14 21 42
2017-01-31 14 22 08

@patchthecode
Copy link
Owner

OK, this should not crash your app.

Your loadDataFromServer takes about how many seconds?
I am trying to re-create this on my end in my example application.
If you can recreate the issue there on the example application, this will be very helpful as well.

But if you cant, its cool. I'm investigating.
Also, I have swift 3, not swift 3.0.2. I'm not sure of the changes in there yet.
Will have to look into it.

@Tsarfolk
Copy link
Author

Tsarfolk commented Feb 1, 2017

I recreated it

calendarView.reloadData {
            self.calendarView.reloadData {
                self.calendarView.visibleDates { (visibleDates: DateSegmentInfo) in
                    self.setupViewsOfCalendar(from: visibleDates)
                }
            }
        }

or simpler

DispatchQueue.main.async {
            self.calendarView.reloadData {
                self.calendarView.visibleDates { (visibleDates: DateSegmentInfo) in
                    self.setupViewsOfCalendar(from: visibleDates)
                }
            }
}

in the viewDidLoad at example app

console log:

JTAppleCalendar iOS Example(62077,0x10c1df3c0) malloc: *** error for object 0x60800022ba44: > Invalid pointer dequeued from free list
*** set a breakpoint in malloc_error_break to debug

@patchthecode
Copy link
Owner

OK. I can re-create the error now. Looking into it

@patchthecode
Copy link
Owner

I think this issue is now fixed from this commit -> f368553

Let me know if you are still experiencing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants