例如:
let realm = Realm()let modelObjects = realm.objects(MyModel) // => Say there are 1000 itemsfor i in 100..<110 { let itemAtIndex = modelObjects[i] // => Inferred to be of type `MyModel` itemAtIndex.someProperty // => Only at this point is data *just for that property* read from disk // Perform operations in memory here...}// At this point,only 10 objects were ever read from disk// and only the propertIEs on those objects that were accessed.
我在这个例子中使用了Realm Swift,但是相同的概念适用于Realm Objective-C.
总结以上是内存溢出为你收集整理的ios – 使用Realm获取一定数量和一些偏移量(https://realm.io/)全部内容,希望文章能够帮你解决ios – 使用Realm获取一定数量和一些偏移量(https://realm.io/)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)