我在一个混合的Swift/Obj C项目中使用RestKit 0.26.0。我们正在Swift文件中建立关系映射,当我正常运行或构建项目时,一切正常。RestKit RKAttributeMapping fromKeyPath错误归档
但是,当我尝试归档应用程序以上载以进行分发时,由于与RKAttributeMapping和RKRelationshipMapping中的attributeMappingFromKeyPath:toKeyPath:withMapping方法有关的问题,存档失败。
具体而言,当我存档,我得到这个错误:
'(fromKeyPath: String!, toKeyPath: String!) -> RKAttributeMapping' is not convertible to '(fromKeyPath: String!, toKeyPath: String!) -> RKAttributeMapping!'
为代码块:
let errorMapping = RKObjectMapping(forClass: RKErrorMessage.self)
errorMapping.addPropertyMapping(RKAttributeMapping(fromKeyPath: nil, toKeyPath: "userInfo"));
我得到相同/每当我使用一个非常类似的错误attributeMappingFromKeyPath:在其他地方的toKeyPath方法:
mapping.addPropertyMapping(RKRelationshipMapping(fromKeyPath: "(userId).friends", toKeyPath: "friends", withMapping: friendsMapping))
个收益率这个错误:
'(fromKeyPath: String!, toKeyPath: String!, withMapping: RKMapping!) -> RKRelationshipMapping' is not convertible to '(fromKeyPath: String!, toKeyPath: String!, withMapping: RKMapping!) -> RKRelationshipMapping!'
此外,应用程序生成并运行在模拟器完全没问题,用了引发任何错误或警告。它只是在归档期间出现问题。我已经尝试了所有简单的'常识'解决方案,如清理生成文件夹,删除派生数据等。我已经在多台计算机上尝试过它,并且它们都做同样的事情。
编辑:只是意识到,存档构建使用不同的构建配置比我的开发构建,当我更改运行应用程序的构建配置,以使用相同的存档,我得到相同的错误,所以有简单的东西在造成问题的构建配置中更改。
的那些构建设置大概一个使迅速编译器更加严格展开? – Wain
@Wain看起来像是一个安全的赌注,我尝试过并改变了我的开发配置和发布配置之间的构建设置与发布版本之间的任何差异,以强制失败,但目前为止没有骰子。 –