'!='不是前缀一元运算符(SWIFT)

时间:2015-06-27 16:14:50

标签: swift parse-platform operators

拥有并发布Swift和Parse,在线教程已经更新到Swift1.2但是我收到错误,教程不是。在论坛或其他问题上没有任何内容。由于这里和其他学生,已经能够找到并解决一些小问题。但这个让我陷入困境。

提出: -

if(self.object!= nil){'!='不是前缀一元运算符"

var object: PFObject!

override func viewDidLoad() {
    super.viewDidLoad()

    if (self.object !=nil) {

        self.dateField?.text = self.object["date"] as? String
        self.detailsField?.text = self.object["details"] as? String
    }else {
        self.object = PFObject(className: "incident")
    }

    // Uncomment the following line to preserve selection between presentations
    // self.clearsSelectionOnViewWillAppear = false

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem()
}

1 个答案:

答案 0 :(得分:2)

在!=和nil之间加一个空格。