解析Swift IOS-未调用PFCloud callFunctionInBackground选择器 [英] Parse Swift IOS - PFCloud callFunctionInBackground Selector not invoked

查看:109
本文介绍了解析Swift IOS-未调用PFCloud callFunctionInBackground选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从正常情况下调用PFcloud函数时,无论何时使用选择器调用它都会返回正确的计数,选择​​器回调函数不会触发,

When i call the PFcloud function from normal it return the correct count how ever when i call it with selector, the selector call back function is not fired,

赞赏有什么可以指出我的代码中的错误是什么.

Appreciate if any can can point to me what is the mistake in my code.

        PFCloud.callFunctionInBackground(CloudFunctions.getBookingCount, withParameters: ["camp": "pmAwLDTNc6"], block: {
        (result: AnyObject!, error: NSError!) -> Void in
        if ( error === nil) {
            NSLog("Booking Count call back: \(result) ")
        }
        else if (error != nil) {
            NSLog("error in helloWorld: \(error.userInfo)")
        }
    })

不工作块(选择器)-未调用选择器功能

    PFCloud.callFunctionInBackground(CloudFunctions.getBookingCount, withParameters: ["camp": "pmAwLDTNc6"], target: self, selector: "block:")


func block (result: AnyObject!, error: NSError!) {
    if ( error === nil) {
        NSLog("Booking Count from Block: \(result) ")
    }
    else if (error != nil) {
        NSLog("error in helloWorld: \(error.userInfo)")
    }
}

问题:

我需要有人向我强调选择器函数编写中的错误,因为未调用选择器函数.

Question:

I need someone to highlight to my the error in writing the selector function as the selector function is not called.

谢谢

推荐答案

您的方法有两个参数,因此您需要一个类似blockWithResult:error:

Your method has two parameters so you need a selector like blockWithResult:error:

这篇关于解析Swift IOS-未调用PFCloud callFunctionInBackground选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆