世‏足‏杯‏在哪看,会不会延迟啊?

没有更多推荐了,
不良信息举报
举报内容:
Realm数据库 从入门到“放弃”,从此告别sqlist
举报原因:
原文地址:
原因补充:
最多只允许输入30个字
加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!周热销排行
用户评论(0)
在此可输入您对该资料的评论~
添加成功至
资料评价:ios - Convert RLMResults to RLMArray - Stack Overflow
Stack Overflow for Teams
A private, secure home for your team's questions and answers.
to customize your list.
This site uses cookies to deliver our services and to show you relevant ads and job listings.
By using our site, you acknowledge that you have read and understand our
Your use of Stack Overflow’s Products and Services, including the Stack Overflow Network, is subject to these policies and terms.
I am querying over a RLMArray with objectsWhere and i get a RLMResults, but i need a RLMArray with the results a this point in my code.
private var data: RLMArray?
self.data = self.currentSubcategory!.datasheets // is a RLMArray
self.data = self.data!.objectsWhere("is_favourite = 1")
RLMArray has been split into two classes: RLMArray and
RLMResults. RLMArray is now used only for to-many properties on
RLMObject classes, while RLMResults is used for all of the
querying and sorting methods. This was done to reflect that the two
actually had fairly different APIs (for example, RLMResults does not
have addObject:), and they’re expected to diverge further as we add
change notifications for queries.
The migration for this should be as simple as replacing RLMArray
with RLMResults in all of the places that the compiler complains
To go with this, arraySortedByProperty:ascending: has been renamed
to sortedResultsUsingProperty:ascending:, and addObjectsFromArray:
has been renamed to addObjects: to reflect the fact that you can
pass any enumerable object to it (such as NSArray, RLMArray, or
RLMResults).
Hope that's enough
You need to add objects from RLMResult to RLMArray...
@implementation RLMResults (RLMArrayConversion)
- (RLMArray *)toArray {
RLMArray * array = [[RLMArray alloc] initWithObjectClassName:self.objectClassName];
[array addObjects:self];
11.8k989141
let datasheets = self.currentSubcategory!.datasheets!.objectsWhere("is_favourite = 1")
let objects = Array(datasheets.generate())
self.data!.removeAllObjects()
self.data!.addObjects(objects)
Creating the array of the results is required because the self.data!.removeAllObjects() line will also clear datasheets, since RLMResults are live-updating as you make changes to the source.
3,37212531
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Post as a guest
Post as a guest
By clicking &Post Your Answer&, you acknowledge that you have read our updated ,
and , and that your continued use of the website is subject to these policies.
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabledradius mysql问题 rlm_sql_mysql.so 这个文件我怎么都没有找到
[问题点数:20分,结帖人contain_universe]
radius mysql问题 rlm_sql_mysql.so 这个文件我怎么都没有找到
[问题点数:20分,结帖人contain_universe]
不显示删除回复
显示所有回复
显示星级回复
显示得分回复
只显示楼主
匿名用户不能发表回复!|

我要回帖

更多关于 2018足球世界杯 的文章

 

随机推荐