Sometimes this is being thrown when dragging rows in NSBrowser. Don't know what's going on. When I googled this, I've seen some posts around from others, but none had an answer.
Search results for
column
2,071 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I found that appending an .id modifier to the detail column resolved the problem for me: } detail: { if let selectedCocktail { CocktailDetailView(pCocktail: selectedCocktail) .navigationTitle((selectedCocktail.favorite ? (profile.userData.favoriteCocktailsIcon.rawValue) : ) (selectedCocktail.cocktailName ?? )) .id(selectedCocktail.id) //workaround }
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
One workaround would be to change my model to not have nullable fields, and set to when decoding a null. However, that to me, is a kludge. My model data is coming from a database table in Postgres where the column(s) are NULLABLE.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
So I start off with a structure like so:Table ColumnTable Cell View Table View Cell Table View Cell Number FormatterText CellTable ColumnTable Cell View Table View Cell <=- I delete this one Table View CellText CellSo I then delete the one that I pointed at, which is the one I think you're telling me to, so it and the one child go away. Now I drag a check cell into that second column, and then suddenly stuff from other columns disappear as well, and I'm left with this:Table ColumnText CellTable ColumnCheckWhat did I do wrong?
Topic:
UI Frameworks
SubTopic:
AppKit
Tags:
I then use this value and insert it in a Local SQLite DB using the following commandWhat does your database schema look like? Specifically, what is the type of the price column? In general you don’t want to use REAL for currency values because the rules of floating point arithmetic can result in significant rounding errors. In situations like this it is better to store the number of cents in an INTEGER column (that is, fixed point arithmetic). Share and Enjoy — Quinn “The Eskimo!” Apple Developer Relations, Developer Technical Support, Core OS/Hardware let myEmail = eskimo + 1 + @apple.com
Topic:
Programming Languages
SubTopic:
General
Tags:
I do get the hierarchy you outlined:View ScrollView ClipView TableView Column1 => That's the identifier you use (Where in the code I used this?) TableCellView => That's the identifier you have to use TableViewCell Column2Where did I use the Column identifier? Not sure.
Topic:
Programming Languages
SubTopic:
Swift
Tags:
Pretty straightforward, I think, in that children always inherit from parents.If you're asking for a tool/menu that allows you to visualize them, the left column in IB's editor is sorted on hierarchy, just be sure to toggle everything to show.
Topic:
Developer Tools & Services
SubTopic:
General
Tags:
I can think of two possible reasons why this might happen:1. You subclass NSTableView to override makeView (withIdentifier:owner:), but you didn't actually cause an instance of the subclass to be created. Can you verify that your custom makeView method is actually executed?Note that the method is makeView, not make, but I assume that's just a typo in your post.2. You create a NSTableCellView, and you add a text field subview, but you have no code to position the text field within the cell, nor any code to set the size of the text view. If its size is zero, or it's positioned outside the parent view, the column will look empty.Your technique for creating these cells is not a good one. Instead, you should do the following:— Create a XIB file that contains a prototype NSTableCellView for the ligne24 column.— For the File's Owner pseudo-object in the XIB, specify the class of your NSTableViewDelegate object (e.g. a view controller class).— Set the cell view's identifier to ligne24.— Add a text v
Topic:
Programming Languages
SubTopic:
Swift
Tags:
I changed the code to the following: cellIdentifier = CellIdentifiers.LastUsedCell } if let cell = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: cellIdentifier), owner: nil) as? NSTableCellView { // cell.textField?.stringValue = text cell.textField?.stringValue = Test Field print(cell.textField?.stringValue) return cell With this change it tells me that the issue must be in IB for that column because again the only column that it crashes on is itemUsed. Do you agree? After reading your latest post I changed the code. So, here is how the code looks now with the added print statement along with changing owner to self along with print results from console: } else if currentColumn == fieldIdentifiers.LastUsed { print(LastUsed, CellIdentifiers.LastUsedCell) text = dateFormatter.string(from: currentItem.itemLastused!) cellIdentifier = CellIdentifiers.LastUsedCell } if let cell = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: cellIdentifier),
Topic:
Developer Tools & Services
SubTopic:
General
Tags:
Hi @Josedv I'm working on an app with csv read functionality (tapping on a button to open share extension and read a file from Files/...). I managed to find the following in some other thread, which works(ish) for me (I'll explain the ish). I totally agree with @eskimo that you should enforce some sort of formatting rule wherever csv files are generated (this was an ongoing pain at one of my previous jobs), and another pain was to verify the validity of the content, but I guess that's another conversation? It's available from https://github.com/ahltorp/csvparser I used it with Swift 5, and it reads my csv file properly. My csv file was generated using commas as delimiter, nested data as header/detail report style and column order as original. So the ish part, it generates an array of arrays of String ([[String]]), with the first item being the titles for each column (this is particularly useful because this determines the number of columns too, even if one of the rows in that column
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
john daniel wrote:I think most people take up more space than that for icons on buttons.Right. But this will be considerably bigger if you put it in an XML plist.@DenisO, For a rectangular array like this I’d probably put the data into a file in binary form and then memory map that. You can then access the values at random and the VM subsystem will take care of the rest.Furthermore, I’d wrap this in a nice, Swift-friendly data structure. Something like this:class DataMap { let rowCount = 16 let columnCount = 16 init?(file: URL) { guard let d = try? NSData(contentsOf: file, options: [.alwaysMapped]) else { return nil } guard d.length == (self.rowCount * self.columnCount * MemoryLayout<Double>.size) else { return nil } self.data = d let base = d.bytes.assumingMemoryBound(to: Double.self) self.buffer = UnsafeBufferPointer(start: base, count: d.length) } private let data: NSData private let buffer: UnsafeBufferPointer<Double> subscript (row: Int, column: Int) -> Double { precondition((0..&
Topic:
Programming Languages
SubTopic:
Swift
Tags:
Looks like they just changed things around. Click iOS App (or Mac, TV etc. OS) underneath that Ratings and Reviews header in the left column, and I think you'll get the info you're looking for.
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
(It's a while since I had to sort a column, so forgive me if I misremember at any point.)>> I'm using bindings to populate the rows, and I wouldn't expect to set a table view delegate under those circumstancesYou almost always end up wanting a delegate for something or other, so it's usual to have one. But you don't need to do anything with tableView(_:sortDescriptorsDidChange:) in your scenario. The array controller will do the heavy lifting for you.>> do bindings just replace the dataSource … ?Yes, they do. If you use bindings, you don't need a data source (and it can be nil). However, for historical reasons, methods that deal with dragging rows are in the data source protocol, not the delegate protocol. If you need to support dragging, you will need to use a data source after all. In this case, you do not implement the data source methods that the documentation says you must implement. You just implement the ones you need to support dragging.>> I am already using an NSArrayContro
Topic:
Developer Tools & Services
SubTopic:
General
Tags:
Using a TableColumn requires a Table {// content } rows: { // data source } pattern similar to below. Where in the example rowItems is a collection of Items for the data source. Items struct Item { let from: Date let to: Date let hours: Double } // The table view Table(selection: $selection, sortOrder: $sortOrder) { // Sort column on .from key value path of item TableColumn(From, value:.from) { item in Text(item.from(date: .numeric, time: .omitted)) } // Sort column on .to key value path of item TableColumn(To, value:.to) { item in Text(item.to.formatted(date: .numeric, time: .omitted)) } // Sort column on .hours key value path of item TableColumn(Total, value:.hours) { item in Text(item.hours) } } rows: { // Populate the rows data source with TableRow types containing an item type from the rowItems collection which is passed on each TableColumm. ForEach(rowItems) { item in TableRow(item) } } See Apple example code here: https://developer.apple.com/documentation/swiftui/building_a_g
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Having the same issue here. Still not solved for me. As sole user (Admin, Account Holder Role) I get no View and Agree to Terms button in Action column or any other possibility to agree.
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
Tags: