问题描述
Parse (1.7.1) 和 Xcode (6.3) 的最新版本我无法自动完成用于 parse 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?
之前,与其他所有块一样,您可以使用 Tab 键突出显示它,然后按 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:块不会自动完成.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!