【问题标题】:Parse With Swift: this class is not key value coding-compliant for the key submit.'Parse With Swift:这个类不符合键提交的键值编码。
【发布时间】:2014-11-26 22:41:02
【问题描述】:

更新:

想通了,我使用的是弱变量而不是强变量

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

这是我遇到错误的视图控制器

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) 完全删除该问题。

标签: xcode swift parse-platform


【解决方案1】:

将弱变量改为强变量

【讨论】:

  • 以目前的形式,这个答案不太可能对其他人有帮助。您能否提供更多详细信息?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-04-01
  • 1970-01-01
  • 2016-09-10
  • 2019-06-23
  • 1970-01-01
  • 2017-11-29
  • 2014-01-12
相关资源
最近更新 更多