Post

Replies

Boosts

Views

Activity

Reply to Can't downgrade MacBook with external ssd
I'm not sure why it isn't working for you, but I'll tell you how I manage booting various OS versions from an external disk. Shut down the computer, boot into Recovery. by holding down the power button until Options appears. Enable booting from external volumes, in Startup Security. Reboot. Connect your external disk, in Disk Utility, select the entire disk (ESD310S...) and partition it. Select APFS as the partition type. After that is done, you'll have one volume called Untitled. Rename the Untitled volume to "OS Installers". Select the Container disk above the Untitled volume and choose to add a volume to it. Make the new volume APFS, call it "Sonoma". Then, softwareupdate --list-full-installers, to get the correct name for the installer. softwareupdate --fetch-full-installer --full-installer-version 14.6.1, for example. This will download an installer called "Install macOS Sonoma" to your /Applications folder. Drag the installer from /Applications to the "OS Installers" volume (I like to keep them around). Double-click Install macOS Sonoma, wait a while until it is verified. Once it is ready, you should be able to go through the steps to install Sonoma onto your external disk (volume), called Sonoma, and boot from it.
Topic: Community SubTopic: Apple Developers Tags:
Sep ’24
Reply to Child view does at first display when row selected in parent view
I tried your code and found the same thing. These posts talk about some similar issues. https://forums.developer.apple.com/forums/thread/661777 https://forums.developer.apple.com/forums/thread/659660 this one has a solution that worked https://forums.developer.apple.com/forums/thread/714912?answerId=728415022#728415022 here's your code, working (based on the solution in the last link above), but it doesn't look like your original implementation: @Environment(\.dismiss) var dismiss var mealName: String var body: some View { VStack { Text(mealName) Button("OK") { dismiss() } } .padding() } } struct ContentView: View { @State var meals: [Meal] = [ Meal(name: "filet steak"), Meal(name: "pepperoni pizza"), Meal(name: "pancakes"), Meal(name: "full breakfast") ] @State private var selectedMeal: Meal? var body: some View { NavigationStack { List { ForEach(meals) { meal in HStack { Button { selectedMeal = meal } label: { Text(meal.name) .font(.headline) } } } } .sheet(item: $selectedMeal) { item in SheetView(mealName: item.name) } } } } class Meal: Identifiable { var id: UUID = UUID() var name: String = "" init() {} init(id: UUID = UUID(), name: String) { self.id = id self.name = name } } that is, it has buttons not just simply lines of text. here's code that works around the issue another way, by passing a binding to the sheet and using a small delay before changing isShowingMealForm. @Environment(\.dismiss) var dismiss @Binding var mealName: String var body: some View { VStack { Text(mealName) Button("OK") { dismiss() } } .padding() } } struct ContentView: View { @State var meals: [Meal] = [ Meal(name: "filet steak"), Meal(name: "pepperoni pizza"), Meal(name: "pancakes"), Meal(name: "full breakfast") ] @State private var isShowingMealForm = false @State private var selectedMeal: Meal? @State private var mealName: String = "no meal selected" var body: some View { NavigationStack { List { ForEach(meals) { meal in HStack { Text(meal.name) .font(.headline) } .onTapGesture { if self.isShowingMealForm { self.isShowingMealForm = false DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) { self.selectedMeal = meal self.mealName = meal.name self.isShowingMealForm = true } } else { self.selectedMeal = meal self.mealName = meal.name self.isShowingMealForm = true } } } } } .sheet(isPresented: $isShowingMealForm) { SheetView(mealName: $mealName) } } } class Meal: Identifiable { var id: UUID = UUID() var name: String = "" init() {} init(id: UUID = UUID(), name: String) { self.id = id self.name = name } } This works too, but I am a loss to clearly explain why. I put a breakpoint in your original onTapGesture closure, and I can clearly see self.selectedMeal obstinately staying at nil even after the line self.selectedMeal = meal. It only works as expected after you click on another meal line. I'm not at all comfortable with arbitrary delays in code, and the version with .sheet(item) has fewer lines of code than the one with .sheet( isPresented: ), so I'd go with that. I'd love it if someone who understands this stuff could chime in and tell us why the observed behavior differs from the expected though.
Topic: UI Frameworks SubTopic: SwiftUI
Aug ’24
Reply to How to view USB descriptors?
that's interesting. I have version 666.4.0 of USB Prober, and it works for viewing USB descriptors on Apple Silicon (for me). It does a fine job of displaying parsed descriptors, better than the utilities I have found on Windows. I don't use it for anything else. I probably installed it long ago on an Intel machine, and the binary runs on my M1 Mac. The code is ancient - the logging function appears to rely on a kernel extension which simply isn't there any more. Related source code is at https://opensource.apple.com/source/IOUSBFamily/IOUSBFamily-540.4.1/USBProberV2/, in case anyone wants to stake a stab at modernizing it.
Aug ’24
Reply to Need free Apple developer account
Please see here https://developer.apple.com/support/compare-memberships For your own use on your own machine, you can "sign to run locally", and make up a bundle identifier for your app. If you need restricted entitlements, you need a paid account to request them. I don't know what you mean by "signingkey" and "signingkeyId". Are these Apple things or AWS things?
Jul ’24
Reply to Apple store connect requests sandbox entitlement for the PCI DriverKit System Extension
reply to the review team and tell them it is an Xcode bug, you're welcome to refer to the bug I filed FB13688443 "Xcode strips App Sandbox entitlement from dext". It would be good if you filed your own bug. Here are my steps to reproduce: create a new macOS project. observe that the newly-created app target in the project has a .entitlements file. By default, that .entitlements file contains an App Sandbox = YES entry. add a new DriverKit project to the target observe that the dext target does not have a .entitlements file. Note that this page https://developer.apple.com/documentation/driverkit/requesting_entitlements_for_driverkit_development says “Xcode provides a default entitlements file for every new DriverKit driver you create. “ no, it doesn’t. Archive the application, then export the archive to a local copy. Use codesign -dvvv —entitlements - to dump the entitlements of the dext. Return to the Xcode project, add a DriverKit capability to the dext target using the + button on the Signing and Capabilities page. This causes a .entitlements file to be added to the dext target, but it doesn’t have an App Sandbox entitlement in it. This page: https://developer.apple.com/documentation/driverkit/requesting_entitlements_for_driverkit_development says “The default driver entitlements file contains only the DriverKit and App Sandbox entitlements.” But it doesn’t contain any entitlements by default. In the newly-created .entitlements file for the dext, add two entitlements, one called “Fake-entitlement”, and the App Sandbox entitlement. Archive the app again, export it to a local copy, and examine the entitlements of the dext now. App Sandbox is absent, but Fake-entitlement is present.
Topic: Code Signing SubTopic: Entitlements Tags:
Jul ’24
Reply to on-line entitlement format to obtain relevant "transport.usb|idVendor"
are you building for development or for distribution? The auto-generated profile for a development build will include the "*" wildcard for idVendor. Your entitlement for your driver (which you specify should contain the specific vendor ID values, just like your IOKit personality dictionary. When you build for distribution, you have to do some steps manually. There was a fairly recent post about this by Kevin Elliot, but of course I can't find it now.
Topic: App & System Services SubTopic: Drivers Tags:
Jul ’24
Reply to How to create a variable that can be used or changed in all swift files
I think you need to re-phrase your question. The question in your title is fairly easy to answer. By default, a variable declared in any one .swift file in your program is available to any other .swift file in your program. (search for "Access Levels" in the Swift Programming Language reference from Apple). I don't understand what you mean by "files, settings and home" here.
Jul ’24
Reply to When two memset struct with the same name will crash on ios18 beta1
If I understand you correctly, you are re-declaring struct A, exposed via a pointer in the SDK, from a 1000 byte struct to a 1400 byte struct. If it is allocated in the SDK (1000 bytes), and you memset it from main (1400 bytes), memset will run off the end of the struct and overwrite 400 bytes of memory, somewhere, with unpredictable effects. Did you expect this to reliably crash at any time, on any OS? Did you expect it to be benign? memset will do what it is asked to do.
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’24
Reply to DriverKit CompleteAsyncIO callback
A timeout value of 0 means "never" (https://developer.apple.com/documentation/usbdriverkit/iousbhostpipe/3182647-asyncio). Your request is either never being delivered to the bus, or is being ignored by your device. In circumstances like these, I like to hang a USB analyzer on the bus to see what the device is actually doing. Also check all the return values from your calls.
Topic: App & System Services SubTopic: Drivers Tags:
Jun ’24
Reply to Can't downgrade MacBook with external ssd
I'm not sure why it isn't working for you, but I'll tell you how I manage booting various OS versions from an external disk. Shut down the computer, boot into Recovery. by holding down the power button until Options appears. Enable booting from external volumes, in Startup Security. Reboot. Connect your external disk, in Disk Utility, select the entire disk (ESD310S...) and partition it. Select APFS as the partition type. After that is done, you'll have one volume called Untitled. Rename the Untitled volume to "OS Installers". Select the Container disk above the Untitled volume and choose to add a volume to it. Make the new volume APFS, call it "Sonoma". Then, softwareupdate --list-full-installers, to get the correct name for the installer. softwareupdate --fetch-full-installer --full-installer-version 14.6.1, for example. This will download an installer called "Install macOS Sonoma" to your /Applications folder. Drag the installer from /Applications to the "OS Installers" volume (I like to keep them around). Double-click Install macOS Sonoma, wait a while until it is verified. Once it is ready, you should be able to go through the steps to install Sonoma onto your external disk (volume), called Sonoma, and boot from it.
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to Driver Kit App Signing for Release On iPad
did you find this post? https://forums.developer.apple.com/forums/thread/751490
Topic: Code Signing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to Child view does at first display when row selected in parent view
I tried your code and found the same thing. These posts talk about some similar issues. https://forums.developer.apple.com/forums/thread/661777 https://forums.developer.apple.com/forums/thread/659660 this one has a solution that worked https://forums.developer.apple.com/forums/thread/714912?answerId=728415022#728415022 here's your code, working (based on the solution in the last link above), but it doesn't look like your original implementation: @Environment(\.dismiss) var dismiss var mealName: String var body: some View { VStack { Text(mealName) Button("OK") { dismiss() } } .padding() } } struct ContentView: View { @State var meals: [Meal] = [ Meal(name: "filet steak"), Meal(name: "pepperoni pizza"), Meal(name: "pancakes"), Meal(name: "full breakfast") ] @State private var selectedMeal: Meal? var body: some View { NavigationStack { List { ForEach(meals) { meal in HStack { Button { selectedMeal = meal } label: { Text(meal.name) .font(.headline) } } } } .sheet(item: $selectedMeal) { item in SheetView(mealName: item.name) } } } } class Meal: Identifiable { var id: UUID = UUID() var name: String = "" init() {} init(id: UUID = UUID(), name: String) { self.id = id self.name = name } } that is, it has buttons not just simply lines of text. here's code that works around the issue another way, by passing a binding to the sheet and using a small delay before changing isShowingMealForm. @Environment(\.dismiss) var dismiss @Binding var mealName: String var body: some View { VStack { Text(mealName) Button("OK") { dismiss() } } .padding() } } struct ContentView: View { @State var meals: [Meal] = [ Meal(name: "filet steak"), Meal(name: "pepperoni pizza"), Meal(name: "pancakes"), Meal(name: "full breakfast") ] @State private var isShowingMealForm = false @State private var selectedMeal: Meal? @State private var mealName: String = "no meal selected" var body: some View { NavigationStack { List { ForEach(meals) { meal in HStack { Text(meal.name) .font(.headline) } .onTapGesture { if self.isShowingMealForm { self.isShowingMealForm = false DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) { self.selectedMeal = meal self.mealName = meal.name self.isShowingMealForm = true } } else { self.selectedMeal = meal self.mealName = meal.name self.isShowingMealForm = true } } } } } .sheet(isPresented: $isShowingMealForm) { SheetView(mealName: $mealName) } } } class Meal: Identifiable { var id: UUID = UUID() var name: String = "" init() {} init(id: UUID = UUID(), name: String) { self.id = id self.name = name } } This works too, but I am a loss to clearly explain why. I put a breakpoint in your original onTapGesture closure, and I can clearly see self.selectedMeal obstinately staying at nil even after the line self.selectedMeal = meal. It only works as expected after you click on another meal line. I'm not at all comfortable with arbitrary delays in code, and the version with .sheet(item) has fewer lines of code than the one with .sheet( isPresented: ), so I'd go with that. I'd love it if someone who understands this stuff could chime in and tell us why the observed behavior differs from the expected though.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Aug ’24
Reply to User information doesn't appear
You haven't made it clear what the actual issue is. You talk about differences in "the section for displaying user information", which is presumably UserInfoView, but you have shown us only your UserInfoView, not also the tutorial's UserInfoView. What did you expect to see?
Replies
Boosts
Views
Activity
Aug ’24
Reply to How to view USB descriptors?
that's interesting. I have version 666.4.0 of USB Prober, and it works for viewing USB descriptors on Apple Silicon (for me). It does a fine job of displaying parsed descriptors, better than the utilities I have found on Windows. I don't use it for anything else. I probably installed it long ago on an Intel machine, and the binary runs on my M1 Mac. The code is ancient - the logging function appears to rely on a kernel extension which simply isn't there any more. Related source code is at https://opensource.apple.com/source/IOUSBFamily/IOUSBFamily-540.4.1/USBProberV2/, in case anyone wants to stake a stab at modernizing it.
Replies
Boosts
Views
Activity
Aug ’24
Reply to USB drive invisible to our app on supervised iPad
I tried again with a different iPad and the same configuration - it worked as expected. When I returned to the original iPad, wiped it, re-enrolled it, and re-installed the profile, that iPad worked as expected too.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to What is the recommended way to count files recursively in a specific folder
man readdir ?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’24
Reply to Need free Apple developer account
Please see here https://developer.apple.com/support/compare-memberships For your own use on your own machine, you can "sign to run locally", and make up a bundle identifier for your app. If you need restricted entitlements, you need a paid account to request them. I don't know what you mean by "signingkey" and "signingkeyId". Are these Apple things or AWS things?
Replies
Boosts
Views
Activity
Jul ’24
Reply to Apple store connect requests sandbox entitlement for the PCI DriverKit System Extension
reply to the review team and tell them it is an Xcode bug, you're welcome to refer to the bug I filed FB13688443 "Xcode strips App Sandbox entitlement from dext". It would be good if you filed your own bug. Here are my steps to reproduce: create a new macOS project. observe that the newly-created app target in the project has a .entitlements file. By default, that .entitlements file contains an App Sandbox = YES entry. add a new DriverKit project to the target observe that the dext target does not have a .entitlements file. Note that this page https://developer.apple.com/documentation/driverkit/requesting_entitlements_for_driverkit_development says “Xcode provides a default entitlements file for every new DriverKit driver you create. “ no, it doesn’t. Archive the application, then export the archive to a local copy. Use codesign -dvvv —entitlements - to dump the entitlements of the dext. Return to the Xcode project, add a DriverKit capability to the dext target using the + button on the Signing and Capabilities page. This causes a .entitlements file to be added to the dext target, but it doesn’t have an App Sandbox entitlement in it. This page: https://developer.apple.com/documentation/driverkit/requesting_entitlements_for_driverkit_development says “The default driver entitlements file contains only the DriverKit and App Sandbox entitlements.” But it doesn’t contain any entitlements by default. In the newly-created .entitlements file for the dext, add two entitlements, one called “Fake-entitlement”, and the App Sandbox entitlement. Archive the app again, export it to a local copy, and examine the entitlements of the dext now. App Sandbox is absent, but Fake-entitlement is present.
Topic: Code Signing SubTopic: Entitlements Tags:
Replies
Boosts
Views
Activity
Jul ’24
Reply to on-line entitlement format to obtain relevant "transport.usb|idVendor"
are you building for development or for distribution? The auto-generated profile for a development build will include the "*" wildcard for idVendor. Your entitlement for your driver (which you specify should contain the specific vendor ID values, just like your IOKit personality dictionary. When you build for distribution, you have to do some steps manually. There was a fairly recent post about this by Kevin Elliot, but of course I can't find it now.
Topic: App & System Services SubTopic: Drivers Tags:
Replies
Boosts
Views
Activity
Jul ’24
Reply to How to create a variable that can be used or changed in all swift files
I think you need to re-phrase your question. The question in your title is fairly easy to answer. By default, a variable declared in any one .swift file in your program is available to any other .swift file in your program. (search for "Access Levels" in the Swift Programming Language reference from Apple). I don't understand what you mean by "files, settings and home" here.
Replies
Boosts
Views
Activity
Jul ’24
Reply to What are your experiences with "Code Level Support," and how should it work?
in the past, I've received emails from dts with case ID numbers, usually the same day I submitted the request. An actual reply from a person takes a bit longer, depending on weekends, holidays, the complexity of the request.
Replies
Boosts
Views
Activity
Jul ’24
Reply to App Sandbox entitlement stripped from dext by Xcode?
Hi @KivancG I "solved" the problem by contacting the app review team and referencing the bug, FB13688443.
Topic: Code Signing SubTopic: Entitlements Tags:
Replies
Boosts
Views
Activity
Jul ’24
Reply to When two memset struct with the same name will crash on ios18 beta1
If I understand you correctly, you are re-declaring struct A, exposed via a pointer in the SDK, from a 1000 byte struct to a 1400 byte struct. If it is allocated in the SDK (1000 bytes), and you memset it from main (1400 bytes), memset will run off the end of the struct and overwrite 400 bytes of memory, somewhere, with unpredictable effects. Did you expect this to reliably crash at any time, on any OS? Did you expect it to be benign? memset will do what it is asked to do.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to DriverKit CompleteAsyncIO callback
A timeout value of 0 means "never" (https://developer.apple.com/documentation/usbdriverkit/iousbhostpipe/3182647-asyncio). Your request is either never being delivered to the bus, or is being ignored by your device. In circumstances like these, I like to hang a USB analyzer on the bus to see what the device is actually doing. Also check all the return values from your calls.
Topic: App & System Services SubTopic: Drivers Tags:
Replies
Boosts
Views
Activity
Jun ’24