Post

Replies

Boosts

Views

Activity

Reply to How to delete 'Disk not ejected properly'
I have noticed this behaviour recently after upgrading to macOS 13.4, where external drives are disconnected due to the Thunderbolt ports going to sleep when the laptop goes to sleep for an extended period. The option to not turn off hard drives seems to only apply to internal drives/SSD and not externally attached drives. You might needs to file a bug via the feedback app.
Topic: App & System Services SubTopic: Hardware Tags:
Jun ’23
Reply to Using swift or other tool to tell if printer is connected and ready for prints
This will only be true or false if a printer is defined and available and the NSPrinter.printerNames list is non-empty. func isConnectedToPrinter() -> Bool { let printers = NSPrinter.printerNames return !printers.isEmpty } see this GitHub resource on how to query the info you're seeking. https://github.com/marc-medley/004.42Apple_CorePrintingExample/blob/3481a1c8c253f98bbff19741a13cd2c9b8d1d88b/PDFPagePrinter/PDFPagePrinter/PrintData.swift#LL190C9-L203C10 // Printer State var printerState: PMPrinterState = 0 let _ = PMPrinterGetState(pmPrinter, &printerState) d["printerState"] = printerState switch printerState { case UInt16(kPMPrinterIdle) : d["printerStateName"] = "kPMPrinterIdle" case UInt16(kPMPrinterProcessing) : d["printerStateName"] = "kPMPrinterProcessing" case UInt16(kPMPrinterStopped) : d["printerStateName"] = "kPMPrinterStopped" default: d["printerStateName"] = "UNSPECIFIED" } Sean
Topic: UI Frameworks SubTopic: AppKit Tags:
May ’23
Reply to Binding with optional Value causes runtime crash
The property is already a published entity in an observable object. Any changes to the name property will be propagated to the SwiftUI view. The issue was your nameBinding property. Unwrapping viewModel.name is you really had to do then passed the value into a Binding init constant as seen here ChildView(selectedName: .constant(name)). struct ParentView: View { @StateObject var viewModel = Model() var body: some View { VStack(alignment: .leading, spacing: 8) { Text("Name is \(viewModel.name ?? "nil")") Button("Make name nil") { viewModel.makeNameNil() } if let name = viewModel.name { ChildView(selectedName: .constant(name)) } } .padding() } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’23
Reply to how to resolve failed to emit precompiled header this error.
Did you try cleaning the build and its build folder?
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to Fake Downloads Attempting to Take Down my App
Technically it is Apple's job to throttle and regulate download patterns like this via the store instead of punishing the developer, but I'm not a lawyer.
Replies
Boosts
Views
Activity
Jun ’23
Reply to Is Core Data fading out?
It's most likely a wrapper around core data to make for a quicker implementation process similar to how RoomDB for Android and Realm works.
Replies
Boosts
Views
Activity
Jun ’23
Reply to How to delete 'Disk not ejected properly'
I have noticed this behaviour recently after upgrading to macOS 13.4, where external drives are disconnected due to the Thunderbolt ports going to sleep when the laptop goes to sleep for an extended period. The option to not turn off hard drives seems to only apply to internal drives/SSD and not externally attached drives. You might needs to file a bug via the feedback app.
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to XMMP Back Ground Socket
Please post this question on the respective GitHub project and/or open an issue there if one is not already opened. https://github.com/robbiehanson/XMPPFramework
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to Precision issue with 'Double' data type in Swift
Here you go: let a = 9.495 let b = 0.2 let result = a + b let formatted = String(format: "%0.3f", result) if localization of the numbers are required then make use of the locale parameter: let formatted = String(format: "%0.3f", locale: Locale.current, result) Sean!
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to genstrings doesn't include String(localized:)
Not sure why you will automate something like this during a CI phase outside of any development and developer quality checks for any layout issues before release.
Replies
Boosts
Views
Activity
Jun ’23
Reply to Using swift or other tool to tell if printer is connected and ready for prints
This will only be true or false if a printer is defined and available and the NSPrinter.printerNames list is non-empty. func isConnectedToPrinter() -> Bool { let printers = NSPrinter.printerNames return !printers.isEmpty } see this GitHub resource on how to query the info you're seeking. https://github.com/marc-medley/004.42Apple_CorePrintingExample/blob/3481a1c8c253f98bbff19741a13cd2c9b8d1d88b/PDFPagePrinter/PDFPagePrinter/PrintData.swift#LL190C9-L203C10 // Printer State var printerState: PMPrinterState = 0 let _ = PMPrinterGetState(pmPrinter, &printerState) d["printerState"] = printerState switch printerState { case UInt16(kPMPrinterIdle) : d["printerStateName"] = "kPMPrinterIdle" case UInt16(kPMPrinterProcessing) : d["printerStateName"] = "kPMPrinterProcessing" case UInt16(kPMPrinterStopped) : d["printerStateName"] = "kPMPrinterStopped" default: d["printerStateName"] = "UNSPECIFIED" } Sean
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to Crash on AppStore with SwiftUI for iOS 16.4 with "KitRendererCommon(_:) + 176"
Do you have anything special at lines 10 that can be causing the problem, only meant for debug mode or a specific platform version ?-> ProbabilityDistributionsApp.swift:10
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to 12 core M2 mini only using 4 cores, Intel Mac mini used 6
The OS will determine if all 12 are needed. What is happening - in your case, all 12 cores are being used proportionately at 33.3% each. http_s://eclecticlight.co/2022/02/24/cpu-percentage-is-misleading-on-m1-macs/
Replies
Boosts
Views
Activity
May ’23
Reply to Delay in coredata fetch request on substring search
Is the description attribute index full text? https://developer.apple.com/news/?id=kbcw3mst
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to Get list of all available WiFi networks on iOS
You can't unless you have a business case to backup your request to apple developer for an entitlement.
Replies
Boosts
Views
Activity
May ’23
Reply to Locked out of my bank: needing iOS 13
The iPhone 6 is no longer supported in terms of the latest OS. If price is a concern, the cheapest model I recommend purchasing, renting or taking out on a phone plan is an iPhone SE 2nd edition.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to Sending data between Mac app and iPhone companion app
You will have to explore using Bluetooth.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to Binding with optional Value causes runtime crash
The property is already a published entity in an observable object. Any changes to the name property will be propagated to the SwiftUI view. The issue was your nameBinding property. Unwrapping viewModel.name is you really had to do then passed the value into a Binding init constant as seen here ChildView(selectedName: .constant(name)). struct ParentView: View { @StateObject var viewModel = Model() var body: some View { VStack(alignment: .leading, spacing: 8) { Text("Name is \(viewModel.name ?? "nil")") Button("Make name nil") { viewModel.makeNameNil() } if let name = viewModel.name { ChildView(selectedName: .constant(name)) } } .padding() } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’23