Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xcode 使用Swift解析:此类不符合密钥提交的键值编码;_Xcode_Swift_Parse Platform - Fatal编程技术网

Xcode 使用Swift解析:此类不符合密钥提交的键值编码;

Xcode 使用Swift解析:此类不符合密钥提交的键值编码;,xcode,swift,parse-platform,Xcode,Swift,Parse Platform,更新: 我明白了,我用的是弱变量而不是强变量 我正在尝试学习如何使用swift解析。我制作了一个基本的应用程序,它有一个注册表单,可以推送注册数据进行解析。但是,我在运行应用程序时出错 这是我出错的视图控制器 import UIKit class ViewController: UIViewController { @IBOutlet weak var user: UITextField! @IBOutlet weak var pass: UITextField!

更新:

我明白了,我用的是弱变量而不是强变量

我正在尝试学习如何使用swift解析。我制作了一个基本的应用程序,它有一个注册表单,可以推送注册数据进行解析。但是,我在运行应用程序时出错

这是我出错的视图控制器

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")
            }
        }
    }
}

将弱变量更改为强变量

检查界面生成器并取消附加任何
submit
,因为您自己已经找到了答案,您应该1)回答自己的问题并接受答案,或者2)删除所有问题。以当前形式,这个答案不太可能对其他人有帮助。你能提供更多的细节吗?