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

List of fixes suggested to get Demo-CoreML project working #1

Open
jeffreyfultonca opened this issue Jul 19, 2017 · 0 comments
Open
Assignees

Comments

@jeffreyfultonca
Copy link
Member

jeffreyfultonca commented Jul 19, 2017

Hello @spprichard,

Here's what I suggest you do to get the Demo-CoreML project working:

  • Correct BostonPricer.mlmodel reference in Xcode project from ../../BostonPricer.mlmodel to ../BostonPricer.mlmodel.

  • Assign the ViewController instance as the picker's dataSource and delegate. This can be done either in Interface Builder (IB) or in code in ViewController.viewDidLoad():

     override func viewDidLoad() {
     	super.viewDidLoad()
     	
     	picker.dataSource = self
     	picker.delegate = self
     	
     	generatePrediction()
     }
    
  • Remove the didSet block from @IBOutlet weak var picker: UIPickerView! as it's not actually doing anything. @IBOutlets are set before any of pickerView dataSource code has run. That means the pickerView is empty when that is set and nothing happens.

  • Correct func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, for compoenent: Int) -> String? to func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? or else it will never get called. In case it's hard to see here: for compoenent should be forComponent component.

  • Replace // Generate Prediction comment with actual invocation in pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int). I know you were going to do this anyhow, this is just a reminder.

  • Fix all the AutoLayout issues... Don't feel too bad here, AutoLayout is one of the trickiest things in Xcode development. It's one part science, one part art, one part black magic. People spend years mastering it and it's always changing.

I suggest you attempt these fixes first, then if you want, check out my version in https://github.com/learn-swift-winnipeg/PricePredictor/tree/jeffreys-edits

Good luck!

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

2 participants