Post

Replies

Boosts

Views

Activity

Combobox Dropdown Sizing
Hi, I have a swift MacOS application that has a Combobox dropdown (storyboard). I was wondering if it is possible to change the width of the item dropdown without changing the width of the actual combobox. Some of the items characters are chopped off at the end, but I don't want to expand the width of the actual combobox. If the items scrolled slowly when you hovered over them so users could read the chopped off characters, that would also solve the issue. Thanks so much for the help!
0
0
446
Mar ’20
Xcode notarization and hardened runtime issue
Hi, I'm somewhat new to swift and coding in general, so thanks for your help in advance. I'm building an application that uses Process class to launch a Unix Executable (Swift 5, Cocoa). Unfortunately, when I go to notarize my application, I get the below error. The trouble is, hardened runtime is already enabled and working (along with sandbox). I have tried everything I can think of including removing and re-adding the executable, cleaning build folders, messing with targets, changing hardened runtime exceptions, etc. I have even attempted to force enable hardened runtime on the executable by using "codesign --force --deep --options runtime <Devloper ID Application cert identity> <path to executable>, however, this appears to break the executable, making zsh throw a "Segmentation Fault" when it is run. (the broken executable successfuly passes notarization, but that doesn't help me much) Thanks so much for your help, please tell me if anything was unclear or confusing. 🙂Error:Distribution items ineligible: Error Domain=IDEDistributionMethodDeveloperIDErrorDomain Code=1 "Hardened Runtime is not enabled." UserInfo={NSLocalizedDescription=Hardened Runtime is not enabled., NSLocalizedRecoverySuggestion="myunixexecutable" must be rebuilt with support for the Hardened Runtime. Enable the Hardened Runtime capability in the project editor, test your app, rebuild your archive, and upload again.}
25
0
6.3k
Feb ’20
How do I know if a process is running?
Cocoa MacOS. I am starting a proccess but the .isRunning feature doesn't seem to work for me. The proccess can fail and .isRunning will still return true in multiple cases. Is there any way to get other data about the proccess that can help me determine if it is active or not? The proccess is a cryptominer, so its cpu intensive. If i could return the cpu usage of the proccess, I could determine if it is running or not. Does anyone know how I might do this? Thanks so mcuh for your time!
3
0
681
Feb ’20
How to see if Mac is charging in Swift
Hi, i'm trying to figure out how to detect if the Mac is currently charging in my Swift application. I found lots of information regarding how to do this with UIDevice, but found no information regarding it's MacOS counterpart. Would someone mind pointing me in the right direction? All I need is a simple bool: charging - true/false. Thanks so much!
2
0
1.9k
Jan ’20
New to Swift. Issue connecting data source to combobox.
Hi,I'm new to Swift and have met an issue populating a combobox with a dataset pulled from a PostGreSQL database. I can connect to the database just fine, but I can't figure out how to set the datasource on the dropdown, or otherwise populate the items in the combobox. I am atempting to connect to the database and populate the dropdown in AppDelegate while my UI is in a storyboard. I'm guessing I'm somehow refrencing the combobox incorrectly?If I try to add items to the dropdown individually, the code runs fine but the combobox doesn't populate. If I attempt to set the datasource to a dictionary filled with the Keys and Values I get "Cannot assign value of type '[String : Int]' to type 'NSComboBoxDataSource?'."I know in Windows Forms I can set a name and value for each item in my comboboxes. Is this possible here too?Thanks in advance for your time.guard status == PGConnection.StatusType.ok else { //guards from failed connections print("Connection to database was unsuccessful") print("Error: \(status)") return } let res = p.exec(statement: sqlDropdown) print("select statement result status: \(res.status())") var dropdownItemsDictionary: [String: Int] = [:] let num = res.numTuples() let ComboBox = NSComboBox() for x in 0.. let org_id: Int = Int(res.getFieldString(tupleIndex: x, fieldIndex: 0)!)! let org_name: String = res.getFieldString(tupleIndex: x, fieldIndex: 1)! let org_type: String = res.getFieldString(tupleIndex: x, fieldIndex: 2)! let curr: String = res.getFieldString(tupleIndex: x, fieldIndex: 3)! let mining_addr: String = res.getFieldString(tupleIndex: x, fieldIndex: 4)! print("Entity Index = \(org_id) org_name = \(org_name) org_type = \(org_type) currency = \(String(describing: curr)) mining_addr = \(mining_addr)") dropdownItemsDictionary[org_name] = org_id //ComboBox.addItem(withObjectValue: org_name) } ComboBox.dataSource = dropdownItemsDictionary
3
0
1.4k
Jan ’20