Parse和Xcode:块不会自动完成。 [英] Parse and Xcode: Blocks won't autocomplete.

查看:85
本文介绍了Parse和Xcode:块不会自动完成。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Parse(1.7.1)和Xcode(6.3)的最后一个版本我无法自动完成解析API的块。这真的很烦人。还有其他人有这个问题吗?

The last version of Parse (1.7.1) and Xcode (6.3) I can't autocomplete blocks for parse API. This is really annoying. Does anyone else have this problem?

之前,与其他每个块一样,您可以选项卡突出显示它,然后按Enter键。

Before, like every other blocks, you can tab to highlight it, and then hit enter.

     [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error)
     {

     }];

现在当我点击回车时,会发生这种情况:

Now when I hit enter, this happens:

[query findObjectsInBackgroundWithBlock:(nullable PFArrayResultBlock(nullable )block


推荐答案

新的更新解析带走了输入和完成块的能力。我认为这不好。但这是解决方法。这些块在PFConstants.h中定义喜欢这个

With the new update parse took away the ability to enter and complete the block. I think that is just not good. But here is the workaround. These blocks are defined in PFConstants.h like this

typedef void (^PFBooleanResultBlock)(BOOL succeeded, NSError *PF_NULLABLE_S error);
typedef void (^PFIntegerResultBlock)(int number, NSError *PF_NULLABLE_S error);
typedef void (^PFArrayResultBlock)(NSArray *PF_NULLABLE_S objects, NSError *PF_NULLABLE_S error);
typedef void (^PFObjectResultBlock)(PFObject *PF_NULLABLE_S object,  NSError *PF_NULLABLE_S error);
typedef void (^PFSetResultBlock)(NSSet *PF_NULLABLE_S channels, NSError *PF_NULLABLE_S error);
typedef void (^PFUserResultBlock)(PFUser *PF_NULLABLE_S user, NSError *PF_NULLABLE_S error);
typedef void (^PFDataResultBlock)(NSData *PF_NULLABLE_S data, NSError *PF_NULLABLE_S error);
typedef void (^PFDataStreamResultBlock)(NSInputStream *PF_NULLABLE_S stream, NSError *PF_NULLABLE_S error);
typedef void (^PFStringResultBlock)(NSString *PF_NULLABLE_S string, NSError *PF_NULLABLE_S error);
typedef void (^PFIdResultBlock)(PF_NULLABLE_S id object, NSError *PF_NULLABLE_S error);
typedef void (^PFProgressBlock)(int percentDone);

所以你的代码是

[query findObjectsInBackgroundWithBlock:^(NSArray *PF_NULLABLE_S objects, NSError *PF_NULLABLE_S error)

这里,^(NSArray * PF_NULLABLE_S对象,NSError * PF_NULLABLE_S错误)是PFArrayResultBlock。

Here, ^(NSArray *PF_NULLABLE_S objects, NSError *PF_NULLABLE_S error) is the PFArrayResultBlock.

为了让事情更快,你可以控制点击PFUserResultBlock来查找定义并复制。

To make things quicker you can control click on PFUserResultBlock to find the definition and copy.

这篇关于Parse和Xcode:块不会自动完成。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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