[英]'type' is not a member type of 'T'
Getting compiler error on declaration: type: T.type
: 在声明时获取编译器错误:
type: T.type
:
'type' is not a member type of 'T'
'type'不是'T'的成员类型
public class ParseRealmSync {
public static func synchronize <T: Model> (type: T.type){
var allObjects = [type]()
var limit = 0
var skip = 0
var query = PFQuery(className: T.parseClassName(), predicate: nil)
query.limit = limit
query.skip = skip
query.findObjectsInBackgroundWithBlock { (objects, error) -> Void in
println(objects)
}
}
}
Why? 为什么?
It should be T.Type
instead of T.type
. 它应该是
T.Type
而不是T.type
。
Also 也
var allObjects: [T] = []
instead of 代替
var allObjects = [type]()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.