Post

Replies

Boosts

Views

Activity

Comment on [SwiftData] How to get the first 7 elements by using @Query?
Thank you for your answer. If I want declare a fetch descriptor as a static variable. Do I also need to set value of fetchLimit in the init()? Like this: static var fetchDescriptor = FetchDescriptor<Record>(sortBy: [SortDescriptor(\Record.date, order: .reverse)]) @Query(fetchDescriptor) private var records:[Record] init() { view.fetchDescriptor.fetchLimit = 7 }
Nov ’24
Comment on CrashReportError: Fatal Error in PersistentModel.swift
It works! Thanks!
Replies
Boosts
Views
Activity
Nov ’24
Comment on Label cannot export localized string key
Thank you for your reply. I try to create a new project, and it can be exported normally. I will compare the project to find out the cause of the problem.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’24
Comment on Label cannot export localized string key
I can export the string via this way: Label { Text(“records list”) } icon: { Image(systemImage: “”) } Thanks for answer. I‘m try to set Use Compiler to extract swift strings is no before that way,but not work.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’24
Comment on [SwiftData] How to get the first 7 elements by using @Query?
Thank you for your answer. If I want declare a fetch descriptor as a static variable. Do I also need to set value of fetchLimit in the init()? Like this: static var fetchDescriptor = FetchDescriptor<Record>(sortBy: [SortDescriptor(\Record.date, order: .reverse)]) @Query(fetchDescriptor) private var records:[Record] init() { view.fetchDescriptor.fetchLimit = 7 }
Replies
Boosts
Views
Activity
Nov ’24