最后一个版本的Parse(1.7.1)和
Xcode(6.3)我无法自动完成解析API的块.这真的很讨厌.有没有人有这个问题?
之前,像其他块一样,您可以选择标签来突出显示,然后按Enter键.
[query findObjectsInBackgroundWithBlock:^(NSArray *objects,NSError *error) { }];
现在当我进入,这发生:
[query findObjectsInBackgroundWithBlock:(nullable PFArrayResultBlock(nullable )block
解决方法
使用新的更新解析功能可以消除进入和完成块的能力.我认为这不是很好.但这里是解决方法.这些块在PFConstants.h中定义
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.
为了使事情更快,您可以控制点击PFUserResultBlock来查找定义和复制.