Search results for

column

2,047 results found

Post

Replies

Boosts

Views

Activity

Reply to ML model "Parse issue" expected ;
After looking at this some more this moring I found a work around. I went back to the table of data and removed the spaces from the column heading Day of Week (it was the first column in the CSV file) so that it was DayOfWeek and the code generated correctly. The funny thing is that the other column headings in the table have spaces and it inserts the underscore for them fine.I think it may be a bug with the automatic code generator. Either fix the generator to consistently insert the underscore in all column headers or change the documentation to indicate column headers should contain no spaces.Anyway the workaround worked and everything is now working now.Thanks for looking at this you got me thinking!
Topic: Machine Learning & AI SubTopic: Core ML Tags:
Jul ’18
Reply to How to remove all columns from NSOutlineView?
For example it is useful if you like to build up the view from scratch (with different number of columns and different data in the columns). So, just remove all columns and start again. This is mostly easier than doing all the modifications to existing columns and add and remove individual columns.Here is the error message: *** NSOutlineView cannot remove outlineTableColumn with removeTableColumn:. Use setOutlineTableColumn: instead.
Topic: UI Frameworks SubTopic: AppKit Tags:
Sep ’18
Reply to Tabular classification using Create ML Components
A tabular classifier will return both the classification probabilities and the most likely labels. If your target column name is target the predicted labels column is also going to be target while the probability distributions is going to be in targetProbabilities. You can always print the whole data frame with print(result) and see what the columns are. Hope this helps.
Apr ’23
SwiftUI NavigationSplitView on macOS: unwanted vertical space in detail column
Hi, colleagues: I've spent days trying to understand this little SwiftUI layout problem, and I've made a minimal test app to explain it. It's based on a Content View of a fixed size. import SwiftUI @main struct TestApp: App { var body: some Scene { WindowGroup { ContentView() } .windowResizability(.contentSize) .windowToolbarStyle(.unified(showsTitle: false)) } } struct ContentView: View { let complaint = What's with the vertical space around me when I'm in a detail column? var body: some View { Text(complaint) .font(.title) .frame(width: 300, height: 300) .background(.blue) } } And here's the result. As expected, the Content View is hugged nicely by the window: My goal is to place a fixed-size view like this in the detail column of a Navigation Split View. So I update the scene's root view: import SwiftUI @main struct TestApp: App { var body: some Scene { WindowGroup { NavigationSplitView( sidebar: { }, detail: { ContentView() } ) } .windowResizability(.contentSize) .windowToolbarStyle(
3
0
2.4k
Feb ’24
Reply to Question About Swift
I'm still tweaking it but I was thinking something along these lines...printTable Function Initialize two variables: one to hold the character count of the column label and the other to hold the character count of each itemif the character count of item is greater than the character count in the column label set them equal to each otherfor the column labels, set paddingNeeded equal to the width of each column minus the character count in columnLabelfor the rows, set paddingNeeded equal to width of each column minus the character count of each item or might use a function to compute widths then implement in printTable functionWhat do you think?
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’18
How to animate NavigationSplitView's detailView column.
Having a traditional 'NavigationSplitView' setup, I am looking for a way to animate it the same as the sidebarView, where there is a button to toggle and it animates by sliding out from the right side of the view, however the closest I have gotten was manipulating the 'navigationSplitViewColumnWidth' but that always results in the view instantly appearing / disappearing. I am using SwiftUI for a MacOS specific app. Here is just a general idea of what I am currently doing, it is by no means a reflection of my real code but serves the purpose of this example. struct ContentView: View { @State private var columnWidth: CGFloat = 300 var body: some View { NavigationSplitView { List { NavigationLink(destination: DetailView(item: Item 1)) { Text(Item 1) } NavigationLink(destination: DetailView(item: Item 2)) { Text(Item 2) } NavigationLink(destination: DetailView(item: Item 3)) { Text(Item 3) } } .navigationTitle(Items) } detail: { VStack { DetailView(item: Select an item) Button(action: toggleColumnWidth) { Text(co
1
0
876
Jun ’24
Reply to initial sort of NSTableview
According to the documentation:https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/TableView/SortingTableViews/SortingTableViews.htmlsetting the table column's sortDescriptorPrototype property doesn't tell the table view that the data is sorted on that column. It just tells the table view what sort descriptor to use when the user clicks on that column header.To get the result you want, it looks like you also need to set the table view's sortDescriptors to an array whose first element is the column's sort descriptor. Unfortunately, the documentation isn't very clear on this point, so you may have to experiment a bit, to get your code to do what manually clicking on the column header does.
Topic: UI Frameworks SubTopic: AppKit Tags:
Nov ’17
Reply to How SwiftUI Table sorting works ?
Still not completely clear to me. Lets say I click on Family name column, what happens next? Does the value of sortOrder variable change if I click on Family name column? If yes, what will be the new value? Also, how can I use custom Comparator for different columns?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’23
Reply to This class is not key value coding-compliant error
It crashes on the return from NSTableViewDelegate code. if let cell = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: cellIdentifier), owner: nil) as? NSTableCellView { cell.textField?.stringValue = text print(cell.textField?.stringValue) return cell. ---> Crashes on this return for Column 7 } return nil }t---> Last Line of Code before crash Below is the output from the print statement I added. As you can see it crash after Column 7.. Optional(1) ---> Column 1 Optional(adf) ---> Column 2 Optional(test) ---> Column 3 Optional($450.00) ---> Column 4 Optional(Tax) ---> Column 5 Optional(3) ---> Column 6 Optional(Nov 01 2020) ---> Column 7 2020-11-12 06:32:57.660181-0600 PayMe[13901:179547] [General] [ valueForUndefinedKey:]: this class is not key value coding-compliant for the key itemUsed. 2020-11-12 06:32:57.667836-0600 PayMe[13901:179547] [General] ( 0 CoreFoundation 0x00007ff
Nov ’20
Reply to What's the unit in NSView coordinate system
Maybe my question is too general. I have a need to calculate all width of an NSTableView. However, I found that total width of all columns is far less than NSTableView.bound.width: let width = tableView.tableColumns.reduce(0) { ac, col in ac + col.width } print(width, tableView.bounds.width) This is true even I manually adjust last column so that it fills the gap between the column and tableview right border. -----------| <- table right border last column| -----------| So I assume NSTableColumn.width and NSView.bounds.width are using different units.
Topic: UI Frameworks SubTopic: AppKit Tags:
Mar ’24