Post

Replies

Boosts

Views

Activity

Reply to iOS 15 beta 4 CloudKit Auth Error
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _scheduleAutomatedImportWithLabel:activity:completionHandler:]_block_invoke(2775): <NSCloudKitMirroringDelegate: 0x28326c0c0> - Finished automatic import - SandboxImport - with result: <NSCloudKitMirroringResult: 0x280722dc0> success: 0 madeChanges: 0 error: Error Domain=NSCocoaErrorDomain Code=134410 "(null)" UserInfo={NSUnderlyingError=0x280987db0 {Error Domain=CKErrorDomain Code=36 "CKInternalErrorDomain: 1028" UserInfo={NSUnderlyingError=0x2809a7900 {Error Domain=CKInternalErrorDomain Code=1028 "Account temporarily unavailable due to bad or missing auth token" UserInfo={CKErrorDescription=Account temporarily unavailable due to bad or missing auth token, NSLocalizedDescription=Account temporarily unavailable due to bad or missing auth token, NSUnderlyingError=0x2809a69d0 {Error Domain=CKInternalErrorDomain Code=2011 "Couldn't get an authentication token" UserInfo=0x2812a2200 (not displayed)}}}, CKErrorDescription=Account temporarily unavailable due to bad or missing auth token, NSDebugDescription=CKInternalErrorDomain: 1028, NSLocalizedDescription=Account temporarily unavailable due to bad or missing auth token}}}
Jul ’21
Reply to How to create different scenes with different views by code?
@main struct mindoApp: App { &#9;&#9;@UIApplicationDelegateAdaptor private var appDelegate: AppDelegate &#9;&#9;var body: some Scene { &#9;&#9;&#9;&#9;&#9;&#9; WindowGroup { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; ContentView() &#9;&#9;&#9;&#9;&#9;&#9; } &#9;&#9; } } class AppDelegate: NSObject, UIApplicationDelegate { &#9;&#9;func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { &#9;&#9;&#9;&#9;if options.userActivities.first?.activityType == "newWindow" { &#9;&#9;&#9;&#9;&#9; let configuration = UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) &#9;&#9;&#9;&#9;&#9; configuration.delegateClass = SceneDelegate.self &#9;&#9;&#9;&#9;&#9; return configuration &#9;&#9;&#9;&#9;} else { &#9;&#9;&#9;&#9;&#9; return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) &#9;&#9;&#9; } } class SceneDelegate: UIResponder, UIWindowSceneDelegate { &#9;&#9;var window: UIWindow? &#9;&#9;func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { &#9;&#9;&#9;&#9;if let windowScene = scene as? UIWindowScene { &#9;&#9;&#9;&#9;&#9;&#9;let window = UIWindow(windowScene: windowScene) &#9;&#9;&#9;&#9;&#9;&#9;window.rootViewController = UIHostingController(rootView: TestView()) &#9;&#9;&#9;&#9;&#9;&#9;self.window = window &#9;&#9;&#9;&#9;&#9;&#9;window.makeKeyAndVisible() &#9;&#9;&#9;&#9;} &#9;&#9;} } The following code is used to create a new scene/window &#9;&#9;&#9;&#9;UIApplication.shared.requestSceneSessionActivation(nil, userActivity: NSUserActivity(activityType: “newWindow"), options: nil, errorHandler: nil) The TestView can be put into the second scene/window on iPadOS/macOS. But, the App crashes when closing the second scene/window: Fatal error: Attempted to read an unowned reference but object 0x60000061d1c0 was already deallocated
Aug ’20