Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.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
Ios @左值$T5';与';Swift中的任意对象_Ios_Arrays_Swift_Parse Platform - Fatal编程技术网

Ios @左值$T5';与';Swift中的任意对象

Ios @左值$T5';与';Swift中的任意对象,ios,arrays,swift,parse-platform,Ios,Arrays,Swift,Parse Platform,我有一个自定义的TableViewCell,它有一个标签和一个按钮。我有一个Int数组groupVote,它保存将填充UITableView中标签voteScoreLabel的值。点击按钮时,upVoteButtonPressed,使用标签更新单元格的相应值。但是,在下面的代码中有一个错误(我在下面的代码中放入了特定的行),显示:@lvalue$T5”与“AnyObject!”不同!,当我想更新Parse中的值时。这意味着什么?我如何修复它 @IBAction func upVoteButton

我有一个自定义的TableViewCell,它有一个标签和一个按钮。我有一个Int数组
groupVote
,它保存将填充
UITableView
中标签
voteScoreLabel
的值。点击按钮时,
upVoteButtonPressed
,使用标签更新单元格的相应值。但是,在下面的代码中有一个错误(我在下面的代码中放入了特定的行),显示:@lvalue$T5”与“AnyObject!”不同!,当我想更新Parse中的值时。这意味着什么?我如何修复它

@IBAction func upVoteButtonPressed(sender: AnyObject) {
    println(groupVote[voteScoreLabel.tag])
    groupVote[voteScoreLabel.tag]=groupVote[voteScoreLabel.tag]+1
  var messageDisplayTwo = PFQuery(className:currentScreen)
    messageDisplayTwo.whereKey("identifier", equalTo:voteScoreLabel.tag )
    messageDisplayTwo.findObjectsInBackgroundWithBlock {
        (objects: [AnyObject]!, error: NSError!) -> Void in
        if error == nil{
            for object in objects {
                var textNumb=groupVote[self.voteScoreLabel.tag] as Int
                object["vote"]=textNumb //Error Right Here: @lvalue $T5' is not identical to 'AnyObject!


            }

        } else {
            // Log details of the failure

        }
    }

您需要将
对象
强制转换为
PFObject
数组

for object in objects as [PFObject] {
        var textNumb = groupVote[self.voteScoreLabel.tag] as Int
        object["vote"] = textNumb
}

您需要将
对象
强制转换为
PFObject
数组

for object in objects as [PFObject] {
        var textNumb = groupVote[self.voteScoreLabel.tag] as Int
        object["vote"] = textNumb
}

您需要将
对象
强制转换为
PFObject
数组

for object in objects as [PFObject] {
        var textNumb = groupVote[self.voteScoreLabel.tag] as Int
        object["vote"] = textNumb
}

您需要将
对象
强制转换为
PFObject
数组

for object in objects as [PFObject] {
        var textNumb = groupVote[self.voteScoreLabel.tag] as Int
        object["vote"] = textNumb
}
尝试使用以下语法:

query.findObjectsInBackgroundWithBlock{

            (objects: [AnyObject]!, error: NSError!) -> Void in


            if (error == nil) {
                // objects in results will only contain the playerName and score fields

                for object in objects as [PFObject] {
...
...
尝试使用以下语法:

query.findObjectsInBackgroundWithBlock{

            (objects: [AnyObject]!, error: NSError!) -> Void in


            if (error == nil) {
                // objects in results will only contain the playerName and score fields

                for object in objects as [PFObject] {
...
...
尝试使用以下语法:

query.findObjectsInBackgroundWithBlock{

            (objects: [AnyObject]!, error: NSError!) -> Void in


            if (error == nil) {
                // objects in results will only contain the playerName and score fields

                for object in objects as [PFObject] {
...
...
尝试使用以下语法:

query.findObjectsInBackgroundWithBlock{

            (objects: [AnyObject]!, error: NSError!) -> Void in


            if (error == nil) {
                // objects in results will only contain the playerName and score fields

                for object in objects as [PFObject] {
...
...

尝试
作为[NSDictionary]{
@vacawama对象中的对象,我刚刚尝试过,得到错误“无法分配到此表达式的结果”尝试
作为[NSDictionary]{
@vacawama对象中的对象,我刚刚尝试过,得到错误“无法分配到此表达式的结果”尝试
作为对象中的对象[NSDictionary]{
@vacawama我刚刚尝试了这个方法,得到了一个错误“无法分配到这个表达式的结果”尝试
对象作为[NSDictionary]{
@vacawama我刚刚尝试了这个方法,得到了错误“无法分配到这个表达式的结果”