Xcode 6中的AFURLRequestSerialization中的自动综合错误 [英] Auto synthesis error in AFURLRequestSerialization with Xcode 6

查看:91
本文介绍了Xcode 6中的AFURLRequestSerialization中的自动综合错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我在Xcode 6 beta上使用最新的AFNetworking获得的属性streamStatus和streamError,我该如何解决警告自动属性合成不会进行合成,因为它是可读写的,但会通过另一个属性以只读方式进行合成 ?

How do I fix the warning "auto property synthesis will not synthesize because it is readwrite but it will be synthesized readonly via another property" for the properties streamStatus and streamError that I'm getting with the latest AFNetworking on the Xcode 6 beta?

https:// github.com/AFNetworking/AFNetworking/blob/master/AFNetworking/AFURLRequestSerialization.m#L733

这是AFURLRequestSerialization.m的相关行733和734 :

Here's the relavent line in AFURLRequestSerialization.m line 733 and 734:

@interface AFMultipartBodyStream () <NSCopying>
@property (readwrite, nonatomic, assign) NSStreamStatus streamStatus;
@property (readwrite, nonatomic, strong) NSError *streamError;


推荐答案

似乎xcode附带的clang版本6 beta版未授权在扩展名中重写属性,该扩展名不是持有这些属性的原始类的直接扩展。

It seems like the version of clang that ships with xcode 6 beta doesn't authorize to rewrite properties in an extension that is not a direct extension of the original class holding those properties.

删除:

@property (readwrite, nonatomic, assign) NSStreamStatus streamStatus;
@property (readwrite, nonatomic, strong) NSError *streamError;

并替换为:

@interface NSStream ()
@property (readwrite) NSStreamStatus streamStatus;
@property (readwrite, copy) NSError *streamError;
@end

解决了这个问题。

我已经在AFNetworking存储库中打开了拉动请求以解决此问题。

I've opened a pull request in the AFNetworking repo to solve this.

希望这会有所帮助。

这篇关于Xcode 6中的AFURLRequestSerialization中的自动综合错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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