gpt4 book ai didi

objective-c - 使用 Xcode 6 的 AFURLRequestSerialization 中的自动合成错误

转载 作者:太空狗 更新时间:2023-10-30 03:36:37 27 4
gpt4 key购买 nike

对于我在 Xcode 6 beta 上使用最新的 AFNetworking 获得的属性 streamStatus 和 streamError,我如何修复警告“自动属性合成不会合成,因为它是读写的,但它将通过另一个属性只读合成” ?

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

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

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

最佳答案

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

删除:

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

并将其替换为:

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

解决问题。

我打开了一个 pull request在 AFNetworking 存储库中解决这个问题。

希望这对您有所帮助。

关于objective-c - 使用 Xcode 6 的 AFURLRequestSerialization 中的自动合成错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24083358/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com