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

I got an signal SIGABRT error when do in tutorials #858

Closed
sambong0113 opened this issue Aug 20, 2018 · 13 comments
Closed

I got an signal SIGABRT error when do in tutorials #858

sambong0113 opened this issue Aug 20, 2018 · 13 comments

Comments

@sambong0113
Copy link

IMPORTANT - BEFORE CREATING YOUR ISSUE PLEASE READ THE FOLLOWING:

  1. PLEASE STATE THE VERSION NUMBER you are using.
  2. Are you using the latest version of JTAppleCalendar? Latest version is currently 7.1.5
  3. PROVIDE ENOUGH INPORMATION SO I CAN RECREATE THE PROBLEM.

I use an xcode 9.4.1, swift 4, jtapplecalendar 7.1.0
I just do a https://www.youtube.com/watch?v=zOphH-h-qCs tutorials and #553
this is my code.

`

import UIKit
import JTAppleCalendar

class ViewController: UIViewController {
let formatter = DateFormatter()

override func viewDidLoad(){
    super.viewDidLoad()
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
}

}

extension ViewController: JTAppleCalendarViewDataSource, JTAppleCalendarViewDelegate {

func calendar(_ calendar: JTAppleCalendarView, willDisplay cell: JTAppleCell, forItemAt date: Date, cellState: CellState, indexPath: IndexPath) {
    let mycell = cell as! CustomCell
    mycell.dateLabel.text = cellState.text
}



func calendar(_ calendar: JTAppleCalendarView, cellForItemAt date: Date, cellState: CellState, indexPath: IndexPath) -> JTAppleCell {
    let mycell = calendar.dequeueReusableJTAppleCell(withReuseIdentifier: "CustomCell", for: indexPath) as! CustomCell
    mycell.dateLabel.text = cellState.text
    self.calendar(calendar, willDisplay: mycell, forItemAt: date, cellState: cellState, indexPath: indexPath)
    return mycell
}

func configureCalendar(_ calendar: JTAppleCalendarView) -> ConfigurationParameters {
    formatter.dateFormat="yyyy MM dd"
    formatter.timeZone=Calendar.current.timeZone
    formatter.locale = Calendar.current.locale
    
    let startDate = formatter.date(from: "2017 01 01")!
    let endDate = formatter.date(from: "2019 12 31")!
    
    let parameters = ConfigurationParameters(startDate: startDate, endDate: endDate)
    return parameters
}

}
`

what do i wrong??

@sambong0113
Copy link
Author

I'm sorry. I do not set identifier in the custom cell..

@myazdani2010
Copy link

myazdani2010 commented Nov 6, 2018

I have the same issue. following the same video tutorial and implemented both willDisplay and cellForItemAt but they never get called.

I am using: Xcode: 10.1, JTAppleCalendar: 7.1.6, Swift: 4.2, Deployment target: iOS 12.1

Code:

import UIKit
import JTAppleCalendar

class ViewController: UIViewController {

    let formatter = DateFormatter()
    
    
    @IBOutlet weak var calendarView: JTAppleCalendarView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        print("ViewController : viewDidLoad")
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        print("ViewController : didReceiveMemoryWarning")
    }


}



extension ViewController : JTAppleCalendarViewDelegate, JTAppleCalendarViewDataSource {
    
    func calendar(_ calendar: JTAppleCalendarView, willDisplay cell: JTAppleCell, forItemAt date: Date, cellState: CellState, indexPath: IndexPath) {
        print("ViewController : willDisplay")
        let myCustomCell = cell as! CustomCell
        sharedFunctionToConfigureCell(myCustomCell: myCustomCell, cellState: cellState, date: date)
    }
    
    
    
    func calendar(_ calendar: JTAppleCalendarView, cellForItemAt date: Date, cellState: CellState, indexPath: IndexPath) -> JTAppleCell {
        print("ViewController : cellForItemAt")
        
        let cell = calendar.dequeueReusableJTAppleCell(withReuseIdentifier: "CustomeCell", for: indexPath) as! CustomCell
        sharedFunctionToConfigureCell(myCustomCell: cell, cellState: cellState, date: date)
        return cell
    }
    
    
    
    func sharedFunctionToConfigureCell(myCustomCell: CustomCell, cellState: CellState, date: Date) {
        print("ViewController: sharedFunctionToConfigureCell")
        myCustomCell.dateLabel.text = cellState.text
    }

    
   
    func configureCalendar(_ calendar: JTAppleCalendarView) -> ConfigurationParameters {
        print("ViewController : configureCalendar")
        
        formatter.dateFormat = "yyyy MM dd"
        formatter.timeZone = Calendar.current.timeZone
        formatter.locale = Calendar.current.locale
        
        let startDate = formatter.date(from: "2017 01 01")!
        let endDate = formatter.date(from: "2017 12 31")!
        
        let parameters = ConfigurationParameters(startDate: startDate, endDate: endDate)
        return parameters
    }
    
    
}

I followed the view tutorial multiple times to make sure I am not missing anything. Not sure what is wrong!

@patchthecode
Copy link
Owner

zip your sample prject, and send the zip file to me by dragging it into this chat box.
i'll take a look

@myazdani2010
Copy link

here is the project: CalendarTest.zip

@myazdani2010
Copy link

@patchthecode any updates? Sorry I am curious to know what is the issue.

@patchthecode
Copy link
Owner

sorry man. my bad.
i totally missed this because this is a closed issue.
usually i dont miss it if the issue is open.

let me check.
In future, lets create a new issue for things like this.

@myazdani2010
Copy link

Sure @patchthecode, will create new issue next time.

@patchthecode
Copy link
Owner

@myazdani2010 i just looked at you Podfile, and inside it you have
7.0
you do not have 7.1.6
Probably this is the issue?

@myazdani2010
Copy link

Sorry, that didn't work. Thank you for your time @patchthecode

@patchthecode
Copy link
Owner

I am not sure what the problem is then.
Here, i added 7.1.6 to the podfile.
I then did a pod update
i put the project on 12.0 deployment target and every thing is working fine.
here is the file.

CalendarTest 3.zip

@myazdani2010
Copy link

Don't know why it's still the same for me. I had simulator running on iOS 12.1 and I downgrade it to iOS 12.0. Unfortunately still facing the same issue!

@patchthecode
Copy link
Owner

did the zip file i sent you work for you?

@myazdani2010
Copy link

No, it didn't work. Thank you though

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

No branches or pull requests

3 participants