Search results for

“column”

2,085 results found

Post

Replies

Boosts

Views

Activity

Reply to NSTableView: dynamic columns
So, back to what I said before. When you have a cell in a XIB file, you must register the name of the XIB using NSTableView's register(_:forIdentifier:) method before is populated with data. This is typically done in some viewDidLoad method.In your particular scenario, the difficulty comes from managing the cell identifier property, which controls the reuse of existing cells. In your tableView(_:viewFor:row:) method, it doesn't actually matter what your table column identifier is, so long as you use it to choose a cell with a suitable cell identifier. The default is to have them match, because it's easier to keep track of them that way, but it doesn't have to be so.However, in that delegate method, when you invoke makeView(withIdentifier:owner:) specifying a cell identifier that has your XIB file registered against it, the actual cell must have that same identifier. (Otherwise, the documentation says, makeView(withIdentifier:owner:) will return nil.) In case you're keeping track, we're now up to 3 fl
Topic: Programming Languages SubTopic: Swift Tags:
Dec ’17
Reply to Duplicate output with multiple arraycontrollers in a single tableview
It sounds like this is a cell-based table view (each of the columns is bound to …). If that is so, there's a little bit of secret sauce that we normally don't think about. It's the table view that has a content binding to the array controller, not the columns. Normally, you specify the columns as if they are bound all the way through to the model, but the first such binding (according to the documentation) also sets the table content binding (and, I assume, the table view massages the binding between it and the column to be relative to its own bound content).That means you can't bind different columns to different content — which gets bound first will win. Instead, you'll need a single array of objects that have 2 properties, one for each column.But, really, don't use cell-based table views any more. Go with view-based table views. (If you've done that already, then ignore all this.)I strongly suggest you create a custom class to represent the data displayed in eac
Topic: UI Frameworks SubTopic: AppKit Tags:
May ’16
Reply to macOS SwiftUI Table with contextMenu
Did you try to use GeometryReader ? GeometryReader { geometry in NavigationView { Table(items, selection: $selection, sortOrder: $items.sortDescriptors) { TableColumn(Column 1) { Text(Item at ($0.name!)) .contextMenu { Button(action: {}) { Text(Action 1) } Divider() Button(action: {}) { Text(Action 2) } Button(action: {}) { Text(Action 3) } } } TableColumn(Column 2) { Text($0.id.debugDescription) } } .frame(width: geometry.size.width, height: geometry.size.height) // Need to adapt the correct frame to the width of column1
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22
Reply to Instruments: what is static AppName.$main() [inlined]
I submitted FB12211784 the end of May. It contains a do-nothing-much app that creates a two column table of 10K entries. Selecting an item in the table causes the color of the text in the first column to change. On my 2019 intel iMac there is about a 140 msec delay between selection and the color change. That is noticeable. I just re-ran the code using a brand new Mac Studio with M2 Max. It still takes over 100 msec. Still noticeable.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’23
Reply to After filling all fields I still get warning: "Complete test information is required to submit a build for external testing."
After a long correspondance with Apple Developer Program Support they finally told me that the yellow ! warning was just a general reminder that you need to fill out the whole page... Well... I find it quite misleading. And there are other strange peculiarities with the system: When I click on the specific build, the left column menu disappears, and I can't get it back. Not even by logging out and in again. But then I discovered that apparently the left column menu suddenly becomes an expand-/pulldown-menu just below the top menu line... This is a strange system - if you ask ME.
Apr ’21
Reply to Error building instrumentspackage with latest Xcode 13.3
This sounds like you have the same column (same mnemonic) twice somewhere, maybe in a schema definition or when setting up a detail view. But in any case, what should happen is that the instrumentbuilder should not accept input with a duplicate column and instead report a compiler error at the correct line telling you about the duplicate. This doesn't seem to happen for you and this is likely a bug in the instrumentbuilder. Can you please file a bug report via Feedback Assitant.? If possible, please include the instrpkg file that is causing this issue or a simplified file that still reproduces the issue.
Mar ’22
Reply to Accessing Numbers cell values from Swift using Scriptingbridge
Should have added, yes Applescript is working fine but I want to do the processing in Swift: tell selection range set {j1, j2} to {column 1's address, column -1's address} set myResult to rows's cells j1 thru j2's value -- 2d-array for the range --rows's cell j1's value -- 1d-array for 1st column in the range set myCount to 1 set myRow to {} set myArray to {} repeat with myData in myResult set the end of myRow to item 1 of myData set myCount to myCount + 1 if (myCount) is greater than 10 then set myCount to 1 set the end of myArray to myRow set myRow to {} end if end repeat get myArray end tell then to write: set value of cell columnNumber of row rowNumber to myValue
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’20
Reply to SwiftUI LazyVGrid Positioning
Hi, I saw your question a few hours ago and I don't know if you are still looking for an answer at this time. Anyways, here is the solution with an explanation for anyone who might be interested in it. You have a LazyVGrid with two columns which is what you are seeing in the screenshot you've provided. UnitView(), TemperatureView() and CurrencyView() form the first column, whereas DistanceView() and TimeView() form the second column. Since you did not specify the alignment property, it assumed its default value, which is HorizontalAlignment.center in the case of LazyVGrid. If you specify alignment as HorizontalAlignment.leading, then the view would look somewhat like how you want it to look. But, it doesn't look good because the cards are not in the middle of the screen. To solve this, you would have to embed LazyVGrid into a LazyVStack, take the CurrencyView() out of the LazyVGrid, and place it outside LazyVGrid but within LazyVStack. struct ContentView: View { let columns
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’23
Reply to Delete items in collection view with custom layout
Ok... Heres the view controller code, and below it the layout code (poached from StackOverflow if I remember right):import UIKitclass testVCViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, ImagesCVLayoutDelegate { @IBOutlet weak var cv: UICollectionView! @IBOutlet weak var btn: UIButton! @IBAction func btn(_ sender: UIButton) { items.remove(at: 0) cv.deleteItems(at: [IndexPath(row: 0, section: 0)]) // THIS IS WHERE THE WARNINGS AND ERROR OCCUR. cv.reloadData() } var items = [1,2,3,4,5,6,7,8,9] // Data source. func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return items.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cell, for: indexPath) as! zCollectionViewCell cell.lbl.text = (items[indexPath.row]) return cell } func numberOfSections
Topic: Programming Languages SubTopic: Swift Tags:
May ’18
The iPhone set display and brightness to automatic, the App is placed in the dock column at the bottom of the desktop, and the icon showing the dark mode appears in the light mode. Is this a system problem?
The iPhone set display and brightness to automatic, the App is placed in the dock column at the bottom of the desktop, and the icon showing the dark mode appears in the light mode. Is this a system problem? device: iPhone 16 pro max system version: 18.2
0
0
298
Dec ’24
Reply to SwiftUI Table column widths cannot be saved
How? I cannot see how to read the width and I cannot see how to set width? I can fix the width but then the user cannot resize the columns. Are there any way to achieve this with any other components in SwiftUI?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Feb ’25
Reply to NSTableView: dynamic columns
So, back to what I said before. When you have a cell in a XIB file, you must register the name of the XIB using NSTableView's register(_:forIdentifier:) method before is populated with data. This is typically done in some viewDidLoad method.In your particular scenario, the difficulty comes from managing the cell identifier property, which controls the reuse of existing cells. In your tableView(_:viewFor:row:) method, it doesn't actually matter what your table column identifier is, so long as you use it to choose a cell with a suitable cell identifier. The default is to have them match, because it's easier to keep track of them that way, but it doesn't have to be so.However, in that delegate method, when you invoke makeView(withIdentifier:owner:) specifying a cell identifier that has your XIB file registered against it, the actual cell must have that same identifier. (Otherwise, the documentation says, makeView(withIdentifier:owner:) will return nil.) In case you're keeping track, we're now up to 3 fl
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’17
Reply to Duplicate output with multiple arraycontrollers in a single tableview
It sounds like this is a cell-based table view (each of the columns is bound to …). If that is so, there's a little bit of secret sauce that we normally don't think about. It's the table view that has a content binding to the array controller, not the columns. Normally, you specify the columns as if they are bound all the way through to the model, but the first such binding (according to the documentation) also sets the table content binding (and, I assume, the table view massages the binding between it and the column to be relative to its own bound content).That means you can't bind different columns to different content — which gets bound first will win. Instead, you'll need a single array of objects that have 2 properties, one for each column.But, really, don't use cell-based table views any more. Go with view-based table views. (If you've done that already, then ignore all this.)I strongly suggest you create a custom class to represent the data displayed in eac
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
May ’16
Reply to macOS SwiftUI Table with contextMenu
Did you try to use GeometryReader ? GeometryReader { geometry in NavigationView { Table(items, selection: $selection, sortOrder: $items.sortDescriptors) { TableColumn(Column 1) { Text(Item at ($0.name!)) .contextMenu { Button(action: {}) { Text(Action 1) } Divider() Button(action: {}) { Text(Action 2) } Button(action: {}) { Text(Action 3) } } } TableColumn(Column 2) { Text($0.id.debugDescription) } } .frame(width: geometry.size.width, height: geometry.size.height) // Need to adapt the correct frame to the width of column1
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Instruments: what is static AppName.$main() [inlined]
I submitted FB12211784 the end of May. It contains a do-nothing-much app that creates a two column table of 10K entries. Selecting an item in the table causes the color of the text in the first column to change. On my 2019 intel iMac there is about a 140 msec delay between selection and the color change. That is noticeable. I just re-ran the code using a brand new Mac Studio with M2 Max. It still takes over 100 msec. Still noticeable.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to After filling all fields I still get warning: "Complete test information is required to submit a build for external testing."
After a long correspondance with Apple Developer Program Support they finally told me that the yellow ! warning was just a general reminder that you need to fill out the whole page... Well... I find it quite misleading. And there are other strange peculiarities with the system: When I click on the specific build, the left column menu disappears, and I can't get it back. Not even by logging out and in again. But then I discovered that apparently the left column menu suddenly becomes an expand-/pulldown-menu just below the top menu line... This is a strange system - if you ask ME.
Replies
Boosts
Views
Activity
Apr ’21
Reply to Error building instrumentspackage with latest Xcode 13.3
This sounds like you have the same column (same mnemonic) twice somewhere, maybe in a schema definition or when setting up a detail view. But in any case, what should happen is that the instrumentbuilder should not accept input with a duplicate column and instead report a compiler error at the correct line telling you about the duplicate. This doesn't seem to happen for you and this is likely a bug in the instrumentbuilder. Can you please file a bug report via Feedback Assitant.? If possible, please include the instrpkg file that is causing this issue or a simplified file that still reproduces the issue.
Replies
Boosts
Views
Activity
Mar ’22
Reply to This class is not key value coding-compliant error
How many columns have you defined for the tableView in IB Attributes inspector ? I cannot find in doc any reference to itemUsedLast. Is it an object of yours ? If so, check its connection. Could you also show the code ?
Replies
Boosts
Views
Activity
Nov ’20
Reply to How to Enable Finder Comments Tab Programmatically
There is a comments column that can be enabled in Finder. I posted a screen shot of how to enable/show it manually. Is this possible programmatically, for example with Swift in a Finder Sync Extension?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to Where does the money go ?
Go to AppStoreConnect Select Contractual and bank info (last icon): Then select Bank Information Click on the name of the account (in the first column )to view or edit its content:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Core Data Error with NSDate
That is the attribute for date in Core Data store. I am using DB Browser to read the data in Core Data store where every attribute data is stored in a column.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’19
Reply to Accessing Numbers cell values from Swift using Scriptingbridge
Should have added, yes Applescript is working fine but I want to do the processing in Swift: tell selection range set {j1, j2} to {column 1's address, column -1's address} set myResult to rows's cells j1 thru j2's value -- 2d-array for the range --rows's cell j1's value -- 1d-array for 1st column in the range set myCount to 1 set myRow to {} set myArray to {} repeat with myData in myResult set the end of myRow to item 1 of myData set myCount to myCount + 1 if (myCount) is greater than 10 then set myCount to 1 set the end of myArray to myRow set myRow to {} end if end repeat get myArray end tell then to write: set value of cell columnNumber of row rowNumber to myValue
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’20
Reply to SwiftUI LazyVGrid Positioning
Hi, I saw your question a few hours ago and I don't know if you are still looking for an answer at this time. Anyways, here is the solution with an explanation for anyone who might be interested in it. You have a LazyVGrid with two columns which is what you are seeing in the screenshot you've provided. UnitView(), TemperatureView() and CurrencyView() form the first column, whereas DistanceView() and TimeView() form the second column. Since you did not specify the alignment property, it assumed its default value, which is HorizontalAlignment.center in the case of LazyVGrid. If you specify alignment as HorizontalAlignment.leading, then the view would look somewhat like how you want it to look. But, it doesn't look good because the cards are not in the middle of the screen. To solve this, you would have to embed LazyVGrid into a LazyVStack, take the CurrencyView() out of the LazyVGrid, and place it outside LazyVGrid but within LazyVStack. struct ContentView: View { let columns
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to Delete items in collection view with custom layout
Ok... Heres the view controller code, and below it the layout code (poached from StackOverflow if I remember right):import UIKitclass testVCViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, ImagesCVLayoutDelegate { @IBOutlet weak var cv: UICollectionView! @IBOutlet weak var btn: UIButton! @IBAction func btn(_ sender: UIButton) { items.remove(at: 0) cv.deleteItems(at: [IndexPath(row: 0, section: 0)]) // THIS IS WHERE THE WARNINGS AND ERROR OCCUR. cv.reloadData() } var items = [1,2,3,4,5,6,7,8,9] // Data source. func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return items.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cell, for: indexPath) as! zCollectionViewCell cell.lbl.text = (items[indexPath.row]) return cell } func numberOfSections
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’18
The iPhone set display and brightness to automatic, the App is placed in the dock column at the bottom of the desktop, and the icon showing the dark mode appears in the light mode. Is this a system problem?
The iPhone set display and brightness to automatic, the App is placed in the dock column at the bottom of the desktop, and the icon showing the dark mode appears in the light mode. Is this a system problem? device: iPhone 16 pro max system version: 18.2
Replies
0
Boosts
0
Views
298
Activity
Dec ’24