Skip to content

exception thrown #1

@jessephillips

Description

@jessephillips

Forgive me if this is silly for me to suggest. But I got an error when running this app with only some small code changes I made. I'm wondering if something is funky. As a novice, I wasn't able to figure out the problem.

Here's my error:
Thread 1: Exception: "[<Magic_8_Ball.ViewController 0x7fbd385071e0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key askButtonPressed."

my code: viewcontroller.swift
`import UIKit

class ViewController: UIViewController {

@IBOutlet weak var imageView: UIImageView!

@IBAction func askButtonPressed(_ sender: UIButton) {
    let ballsArray = [#imageLiteral(resourceName: "ball3"),#imageLiteral(resourceName: "ball3"),#imageLiteral(resourceName: "ball5"),#imageLiteral(resourceName: "ball2"),#imageLiteral(resourceName: "ball1")]
    imageView.image = ballsArray.randomElement()
}

}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions