我想在swift 4.1下将Realm-objective-c与RLMSupport.swift一起使用,但是此代码片段:
for model in banners {
// do some stuff
}
banners是在Objective-C中定义的BannerModel实例的RLMArray。像这样的定义:
@interface BannerModel : RLMObject
// iid
@property NSString* _Nonnull iid;
@end
RLM_ARRAY_TYPE(BannerModel)
遇到此编译错误:
'RLMArray & BannerModelProtocol' cannot be used as a type conforming to protocol 'Sequence' because 'Sequence' has static requirements
我的Xcode是9.4; Swift 4.1,我尝试过:
Realm-Objc版本3.6.0和3.7.4带有:
pod 'Realm' , '~> 3.6.0'
pod 'Realm' , '~> 3.7.0'
我已经添加了相应的RLMSupport.swift。仍然有相同的编译错误。
有什么想法吗?谢谢!