![](/img/trans.png)
[英]Error "Trailing closure passed to parameter of type 'NSManagedObjectContext' that does not accept a closure" in Swift
我嘗試在 Swift 中向我的應用程序添加實時活動。但是當我嘗試運行該應用程序時,出現錯誤消息“尾隨閉包傳遞給不接受閉包的‘NSManagedObjectContext’類型的參數”。 我的應用程序使用核心數據來保存我的應用程序的數據。 ...
[英]Error "Trailing closure passed to parameter of type 'NSManagedObjectContext' that does not accept a closure" in Swift
我嘗試在 Swift 中向我的應用程序添加實時活動。但是當我嘗試運行該應用程序時,出現錯誤消息“尾隨閉包傳遞給不接受閉包的‘NSManagedObjectContext’類型的參數”。 我的應用程序使用核心數據來保存我的應用程序的數據。 ...
[英]SwiftUI Text(_, style: .timer) bug in Live Activity
我在我的 Live Activity 中添加了Text(Date().addingTimeInterval(2400), style: .timer) ,但是當它的倒計時為零並且通知尚未發送時它開始計數。 可以修復嗎? 我嘗試使用普通計時器,但在實時活動中它不起作用 ...
[英]Update Live Activity once per second - Swift
我正在尋找一種在不使用推送通知的情況下每秒或每 2 秒更新實時活動的方法,同時將應用程序保持在后台。 你有什么建議嗎? 我試過這樣的事情,但幾秒鍾后它停止工作: ...
[英]When creating an iOS live activity I get the error:
創建 iOS 實時活動時出現錯誤: The operation couldn't be completed. (com.apple.ActivityKit.ActivityInput error 0.). The operation couldn't be completed. (com.appl ...
[英]Create state variable only in iOS 16.1?
使用全局變量,這有效: 如果我想嘗試將其變為 state 變量,但我會收到此錯誤“'Activity' is only available in iOS 16.1 or newer”。 是否可以僅在 iOS 16.1 中創建 state 變量? ...