簡體   English   中英

對目標 macOS 10.15 使用 Xcode 12 構建錯誤

[英]Using Xcode 12 build errors for target macOS 10.15

從 Xcode 12.3 開始,當您以 macOS 為目標創建新的 SwiftUI 項目時,Xcode 默認目標為 11.0(Big Sur) 在不更改默認創建的默認“hello world”應用程序中的一行代碼的情況下,我將目標更改為 macOS 10.15(我仍在使用)默認項目 swift 文件將不再構建。:-


@main
struct catalinaApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}```

3 Errors: @main, 'Scene' and WindowGroup is only available in macOS 11.0 or newer

How can I alter the project/above file to correctly build the default app on Catalina? (10.15) ?

thanks in advance!

感謝@Raja Kishan,答案就是在創建新項目時在 Lifecycle 的選項中選擇 App Delegate 選項。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM