Post

Replies

Boosts

Views

Activity

Reply to Help Needed: Linker Warnings and Duplicate Symbols Issue in Xcode 16.0
did you look at the detailed build log to see what the duplicate symbol is, and where it is defined? If you compare the detailed build log with the log from Xcode 15.3, this might guide you to a solution. To access the detailed build log, click on the little hamburger icon on the right of the screenshot you posted. If you think this is a regression in Xcode 16, submit a bug report using Feedback Assistant - bugs reported here aren't tracked, and there isn't enough information in your post for anyone to help you.
Sep ’24
Reply to DriverKit target built as dependency, header not found
I fixed this. The problem was a header file called Driver_public_shared.h, which was included in my Driver.cpp file. It lives on disk beside Driver.cpp. By default, header files have Project membership, so they are not copied into the resulting output bundle. If I give Driver_public_shared.h either Public or Private memberships of the dext target, it appears in the dext in the Headers or PrivateHeaders directory, and I can compile the delivery app, with the driver as a dependency. Interestingly, the header appears in the build folder in the dext in Products/Debug/Debug-driverkit. But the dext which is embedded in the delivery app has no Headers directory. That's fine by me, I didn't want to deliver any headers as part of the driver, but I don't understand why there had to be a Headers folder in some circumstances and not others, nor do I understand why it is removed when embedding the dext.
Sep ’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:
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