您的位置:首页 > 移动开发

NSSortDescriptor ignores Comperator Block

2015-08-29 13:33 381 查看
Thanks to the hint from Paul I was able to figure out what the problem is. The solution can be found in the Apple docs(have a look at the "Fetch Predicates and Sort Description" section).

I thought the NSFetchRequest would just use SQL to fetch the Objects from the SQLite DB and then use the SortDescriptions to sort the fetched objects in memory. This is not ture: it seems that the complete sorting work is handed over to the SQLite store
as well. Of course the Objective-C statements form the block cannot be translated into a SQL query and thus the block is ignored.

referred to link:
http://stackoverflow.com/questions/11022287/nssortdescriptor-ignores-comperator-block
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ISO app