当前位置:网站首页>Coredata acquisition in swift sorting, ascending, descending
Coredata acquisition in swift sorting, ascending, descending
2022-06-30 08:59:00 【Hujiajun】
let request = Todo.fetchRequest()// Get database request
request.sortDescriptors = [NSSortDescriptor(key: "orderID", ascending: true)]
// Pass key key:"orderID" Sort ,ascending: true In ascending order ,false For the descending order
if let todos = try? context.fetch(request)// Get data by request {
// context=AppDelegate.persistentContainer.viewContext
data[section].todos = todos
}else{
printContent(" Failed to get database data !")
}
request.sortDescriptors = [ ] You can put more than one... In the array NSSortDescriptor(key: String, ascending: Bool) Conduct
Arrange in ascending or descending order , When pressing the first NSSortDescriptor(key: String, ascending: Bool) When the arrangement is the same, press
the second NSSortDescriptor(key: String, ascending: Bool) Arrange , And so on .
边栏推荐
- Introduction to the runner of mmcv
- Unity simple shader
- Redis design and Implementation (V) | sentinel sentry
- mysql基础入门 动力节点[老杜]课堂作业
- Detailed explanation of pipline of mmdetection
- Unsupportedclassversionerror is reported when starting jar package. How to repair it
- 基于Svelte3.x桌面端UI组件库Svelte UI
- Introduction to MySQL basics day3 power node [Lao Du] class notes
- Introduction to MySQL basics day4 power node [Lao Du] class notes
- el-input 限制只能输数字
猜你喜欢

Opencv learning notes -day8 (keyboard typing (waitkey()); Wait for typing) action: triggers some action when the appropriate character is typed using the keyboard)

C#访问MongoDB并执行CRUD操作

Opencv learning notes -day3 (mat object and creation related operations mat:: clone(), mat:: copyto(), mat:: zeros(), mat:: ones(), scalar()...)

Gilbert Strang's course notes on linear algebra - Lesson 3

Rew acoustic test (I): microphone calibration

Tidb 6.0: making Tso more efficient tidb Book rush

Flink SQL 自定义 Connector

Use Huawei performance management service to configure the sampling rate on demand

技术管理进阶——管理者如何进行梯队设计及建设

VIM from dislike to dependence (21) -- cross file search
随机推荐
Interference source current spectrum test of current probe
Flink Sql -- toAppendStream doesn‘t support consuming update and delete changes which
Comparaison de deux façons d'accéder à la base de données SQL Server (sqldatareader vs sqldataadapter)
2021-02-27
Pytorch BERT
Influencing factors of echo cancellation for smart speakers
mysql基础入门 day4 动力节点[老杜]课堂笔记
Based on svelte3 X desktop UI component library svelte UI
Gilbert Strang's course notes on linear algebra - Lesson 1
Implementing custom drawer component in quick application
Comparison of two ways for C to access SQL Server database (SqlDataReader vs SqlDataAdapter)
C accesses mongodb and performs CRUD operations
Evaluation standard for audio signal quality of intelligent speakers
Opencv learning notes -day13 pixel value statistics calculation of maximum and minimum values, average values and standard deviations (use of minmaxloc() and meanstddev() functions)
Flink sql -- No factory implements ‘org. apache. flink. table. delegation. ExecutorFactory‘.
Flink Sql -- toAppendStream doesn‘t support consuming update and delete changes which
Qt连接神通数据库
【付费推广】常见问题合集,推荐榜单FAQ
mysql基础入门 动力节点[老杜]课堂作业
How to format an UTC date to use the Z (Zulu) zone designator in php?