Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Kelly Dern
9,309 PointsIssue with factModel.facts[0]
I'm still getting errors with this section. Do you know why this isn't working?
//
// ViewController.swift
// FunFacts
//
// Created by Kelly Dern on 12/16/15.
// Copyright © 2015 Kelly Dern. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var funFactLabel: UILabel!
let factModel = FactModel()
override func viewDidLoad() {
super.viewDidLoad()
funFactLabel.text = factModel.facts[0]
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func showFunFact() {
funFactLabel.text = factModel.facts[1]
}
}
Marina Alenskaja
9,320 PointsMarina Alenskaja
9,320 PointsHi Kelly
Can you tell us what error you are getting? And can you please also include your factModel code, since the error might be in there. Thanks :-)