Posts

Post not yet marked as solved
0 Replies
728 Views
Launch Feedback Assistant, tap new feedback, select macOS - app crashes. This is true on all 3 platforms that I've tried: macOS Ventura beta 13.1 (22C5050e) iOS 16.2 (a) (20C5049e) iPadOS 16.2 (a) (20C5049e)
Posted
by CryptoKoa.
Last updated
.
Post not yet marked as solved
0 Replies
579 Views
I'm attempting to use Xcode & Instruments to Time Profile my app - but there's something in my environment which is preventing Instruments from linking back to source code. It's this way with all of my apps, and even with a recent tutorial from Kodeco (RayWenderlich.com) - so I'm suspecting my environment. In Xcode, I select Product -> Profile, which launches Instruments. I select Time Profiler. I click the record button, use the app such that the area of interest is executed, hit stop. In the Profile section of Instruments, I can see the stack traces, and many of them have function names which are clearly from my app. When I double-click on them, I expect them to show the source code from Xcode (as detailed in apple docs and the Kodeco tutorial). However, instead I get this screen which says "Error: Can't find source code for selected symbol" Most of the question / answers I've seen come from many years ago, which suggests that my problem isn't common - which has me wondering what I've got lurking in my environment that's preventing this from working. I'm using an M1 Mac w/ Ventura 13.1 Beta (22C5044e) and Xcode Version 14.1 (14B47b). Any thoughts will be greatly appreciated...
Posted
by CryptoKoa.
Last updated
.
Post marked as solved
1 Replies
1.1k Views
I’ve got a WatchOS app in the App Store, but since WatchOS 9.1 it’s no longer updating workoutManager.heartRate nor is it saving workout data to Apple’s Health store. Curiously, workoutManager.builder?.elapsedTime, is still correct. No errors are thrown while executing these lines of code: session = try HKWorkoutSession(healthStore: healthStore, configuration: configuration) builder = session?.associatedWorkoutBuilder() … and shortly after this completion block executes, session?.startActivity(with: startDate) builder?.beginCollection(withStart: startDate) { (success, error) in print("WorkoutMgr.startWorkout() - The workout has started.") } … I get the following error messages in my log: 2022-09-28 18:15:01.380071-0500 AppName WatchKit Extension[1240:609337] [workouts] HKLiveWorkoutBuilder_6311 [B194]: (#w0) Failed to update target construction state: Error Domain=com.apple.healthkit Code=3 "Unable to transition to the desired state from the Error(6) state (event 1). Allowed transitions from the current state are: { }" UserInfo={HKErrorParameter=@"", NSLocalizedDescription=Unable to transition to the desired state from the Error(6) state (event 1). Allowed transitions from the current state are: { }, HKErrorClass=HKStateMachine, HKErrorSelector=_handleEvent:date:error:completion:} No developer.apple.com nor StackOverflow.com searches have resulted in any relevant discussions. Any help will be GREATLY appreciated!
Posted
by CryptoKoa.
Last updated
.
Post marked as solved
1 Replies
517 Views
In the following app, all Buttons open the expected app except the 1st one for “MyApp”. MyApp is installed on the iPhone, but I don’t know what I need to do in order for it to behave similarly to Apple’s Maps & Music, and Uber… struct ContentView: View { @Environment(\.openURL) var openURL var body: some View { Button("Launch MyApp") { openURL(URL(string:"MyApp://")!) } Button("Launch Maps") { openURL(URL(string:"Maps://")!) } Button("Launch Music") { openURL(URL(string:"Music://")!) } Button("Launch Uber") { openURL(URL(string:"Uber://")!) } } }
Posted
by CryptoKoa.
Last updated
.
Post marked as solved
2 Replies
887 Views
I have 2 apps in the App Store, and each uses the private database in its own CloudKit container. (ie, App1 uses “iCloud.com.company.App1” and App2 uses “iCloud.com.company.App2”) I want to add a feature to App2 which will require App2 to read/write to the App1 database. To be clear, we’re talking about 2 apps, 2 private databases, but all access occurs under the same user’s AppleID. In App2, I’ve tried to create 2 NSPersistentCloudKitContainers - one for each App’s database as follows: @main struct App2: App { @StateObject var app1DB = PersistenceApp1.shared @StateObject var app2DB = PersistenceApp2.shared @SceneBuilder var body: some Scene { WindowGroup { NavigationView { ContentView() .environmentObject(app1DB) .environmentObject(app2DB) } } } } …where each Persistence object is defined like this… class PersistenceApp1: ObservableObject { static let shared = PersistenceApp1() let container: NSPersistentCloudKitContainer init(inMemory: Bool = false) { container = NSPersistentCloudKitContainer(name: “App1”) // expecting to use CloudKit container id: “iCloud.com.company.App1” … } … } All read & write operations called from App2 using app1DB (unexpectedly) reads & writes the Entity (which was defined in the App1.xcdatamodeld) to show up in “iCloud.com.company.App2”. So I end up with the Entity duplicated inside “iCloud.com.company.App1” as well as “iCloud.com.company.App2”. None of App2’s reads nor writes actually use “iCloud.com.company.App1” - they all just use the duplicate App1 entity that shows up inside of “iCloud.com.company.App2”. Looking in CoreData.NSPersistentCloudKitContainer, I see the following comment: NSPersistentCloudKitContainer managed one or more persistent stores that are backed by a CloudKit private database. By default, NSPersistentContainer contains a single store description which, if not customized otherwise, is assigned to the first CloudKit container identifier in an application's entitlements. Instances of NSPersistentCloudKitContainerOptions can be used to customize this behavior or create additional instances of NSPersistentStoreDescription backed by different containers. Which suggests why I’m seeing this. However, when I look for samples using NSPersistentCloudKitContainerOptions, all I find is references to using the .shared database as promoted via WWDC21-10015 - which focuses on sharing CloudKit data between different users - which is not my use case. Question 1: does anyone have any ideas on how to configure the NSPersistentCloudKitContainerOptions to accommodate my use case? Question 2: does anyone want a micro-consulting gig to help me get this working?
Posted
by CryptoKoa.
Last updated
.
Post marked as solved
2 Replies
1.5k Views
in iOS 16 beta 4, the following code ignores the UITextView.appearance().backgroundColor = .clear struct ContentView: View { @State var text = "Type something here." var body: some View { ZStack { Color.blue.ignoresSafeArea() TextEditor(text: $text) .frame(height: 100) .padding([.leading, .trailing], 40) } .onAppear { UITextView.appearance().backgroundColor = .clear } } } Earlier, I had assumed it was Xcode 14 beta 4 - but further investigation shows that it's the new iOS beta. I would obviously prefer that TextEditor correctly handle it's own .background() method, but in the meantime, any ideas for a workaround?
Posted
by CryptoKoa.
Last updated
.
Post not yet marked as solved
4 Replies
7.3k Views
The following app builds, but causes a runtime crash when trying to execute on an iOS 14.7 device. Using Xcode 13b5, macOS Monterey b5, iOS 15.b6 & iOS 14.7 import SwiftUI struct ContentView: View { @State private var text = "This app causes a runtime error on ios 14.7" @available(iOS 15.0, *) @FocusState var isInputActive: Bool var body: some View { if #available(iOS 15.0, *) { TextEditor(text: $text) .focused($isInputActive) } else { // ios14 or < TextEditor(text: $text) } } }
Posted
by CryptoKoa.
Last updated
.
Post not yet marked as solved
2 Replies
874 Views
Over the past few days, my experience with CloudKit Console has been terribly frustrating... recurring http timeouts, 502 Bad Gateways, and - worst of all - I've got an app which is posting to CloudKit via CoreData and although it DOES sync the data between my devices - CKConsole fails to show ANY records in the specified database... (I've even gone so far as to check BOTH public and private databases, in EACH of the CK Containers associated with my AppleID - desperately hoping to find these records via CKConsole - but alas, no such luck.) Has anyone built an app (or MacOS application) which mirrors (and more importantly, improves upon) the functionality that is supposed to be available via CKConsole? Prior to making the switch to using CloudKit, I've previously used MySQL on a long list of non-iPhone applicaitons - and having access to a command-line interface to the SQL database has always been a very valuable part of my development process. Can anyone suggest ways to re-introduce that CLI type of rapid prototyping into a CloudKit project? Is there a CLI that speaks directly to CloudKit databases (both public and private)? Many thanks...
Posted
by CryptoKoa.
Last updated
.
Post marked as solved
1 Replies
1.7k Views
I'm trying to update to 15 beta 2 a brand new iPad Pro 12.9 running 14.5.1, from a brand new M1 MBAir running Monterrey beta 2 (for M1 Macs), and it was "updating" for a couple of hours. I gave up and then downloaded & installed "Device Support for iOS 15" - and tried again. Same results. I see that there's a known issue regarding the 11" iPad Pro - but does anyone have any suggestions for me? I do have a 2020 iMac that's running Big Sur 11.4 - should I attempt the update from there?
Posted
by CryptoKoa.
Last updated
.