4

Mantle在我的项目中使用序列化对象。该库被许多人使用,我确信错误与它们无关。当我包含Mantle.h或明确MTLJSONAdapter.h包含在注释中的文本块时,它会给出一些不相关的错误MTLJSONAdapter.h

这是MTLJSONAdapter.h发生错误的屏幕截图:

文本块截图

文本块是:

/// A value transformer that should be used for a properties of the given
/// primitive type.
///
/// If `objCType` matches @encode(id), the value transformer returned by
/// +transformerForModelPropertiesOfClass: is used instead.
///
/// The default implementation transforms properties that match @encode(BOOL)
/// using the MTLBooleanValueTransformerName transformer.
///
/// objCType - The type encoding for the value of this property. This is the type
///            as it would be returned by the @encode() directive.
///
/// Returns a value transformer or nil if no transformation should be used.

我得到的错误是:

xcode 错误

#import <Mantle/Mantle.h>删除线时没有错误。BaseModel我按照图书馆的建议在我的班级中导入标题。该类是空的,但这里仅供参考:

基本模型.h 基本模型.m

据我所知,这个错误似乎源于编译器,因为编译器以某种方式解析了注释块中的文本。但是我从来没有遇到过这种情况,可能是什么原因造成的?

我在使用 Xcode 6.3 的优胜美地。我正在与 集成MantleCocoapods并且过去一直这样做并且从未遇到过问题。尽管如此,我尝试擦除所有内容并pod install再次运行无济于事。

4

1 回答 1

2

好吧,我傻了。我正在使用这个配置文件,并将警告视为错误。我几乎不知道该配置文件中也打开了文档警告,所以 Xcode 认为我试图给某些东西一个文档标签。如果其他人遇到同样的问题,我会把它留在这里。

于 2015-05-08T00:38:00.547 回答