user2716025
user2716025

Reputation: 21

Parse With Swift: this class is not key value coding-compliant for the key submit.'

UPDATE:

Figured it out, I was using weak variables instead of strong

I'm trying learn how to use parse with swift. I made a basic app that has a registration form that pushes the registration data to parse. However, I'm getting an error upon running the app.

This is the view controller where I'm having the error

import UIKit

class ViewController: UIViewController {


    @IBOutlet weak var user: UITextField!

    @IBOutlet weak var pass: UITextField!

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    @IBAction func submit(sender: AnyObject) {

        var account:PFUser = PFUser()
        account.username = user.text
        account.password = pass.text

        account.signUpInBackgroundWithBlock{
            (success:Bool!, error:NSError!)->Void in
            if !(error != nil){
                println("Sign Up Successful")
            } else {
                println("Failure")
            }
        }
    }
}

Upvotes: 1

Views: 219

Answers (1)

user2716025
user2716025

Reputation: 21

Change weak variables to strong variables

Upvotes: 1

Related Questions