Search results for

column

2,071 results found

Post

Replies

Boosts

Views

Activity

Reply to Illegal NSTableViewDataSource
I submitted the full code:The crash is on line 62import Cocoa import CoreData class RegistrationReportsViewController: NSViewController { required init?(coder aDecoder: NSCoder) { self.items = [] super.init(coder: aDecoder) } override func viewDidLoad() { super.viewDidLoad() showRegisteredStudents() tableView.dataSource = self tableView.delegate = self tableView.reloadData() } private lazy var fetchedResultsController: NSFetchedResultsController = { let fetchRequest: NSFetchRequest = Registration.fetchRequest() let frc = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: self.persistentContainer.viewContext, sectionNameKeyPath: nil, cacheName: nil) frc.delegate = (self as! NSFetchedResultsControllerDelegate) return frc }() var items: [NSManagedObject] var managedObjectContext = (NSApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext let persistentContainer: NSPersistentContainer = { let container = NSPersistentContainer(name: ScorcentMasterReview) container.lo
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’20
Reply to Core Data code generation causes build failure
If you go to your data model and look at Configurations -> Default you will probably see that in the Class column everything is prefixed with a .. To fix this, go to each of your entities and on the right delete everything inside the module setting so that it goes to Global namespace. This should remove the . and will hopefully mean that your files are now found. If you clean and build again it should all work.
Oct ’16
Reply to swipeActions on macOS?
Even with two columns and a Label. It does not work for me. I am using Xcode 14 and Monterey var body: some View { VStack { List(podcast.episodes!) { episode in EpisodeView(podcast: podcast, episode: episode) .swipeActions(edge: .trailing) { Button (action: { self.deleteEpisode(episode) }) { Label(Delete, systemImage: trash) } .tint(.red) } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’22
Reply to Correct way to label TextField inside Form in SwiftUI
I've never needed to do this, but I've had a quick look, and this seems reasonable: var body: some View { VStack(alignment: .leading) { Form { Text(First Name) TextField(, text: $firstName, prompt: Text(Required)) Text(Last Name) .padding(.top, 10) TextField(, text: $lastName, prompt: Text(Required)) Text(Email) .padding(.top, 10) TextField(, text: $email, prompt: Text(Required)) Text(Job) .padding(.top, 10) TextField(, text: $job, prompt: Text(Required)) Text(Role) .padding(.top, 10) TextField(, text: $role, prompt: Text(Required)) } .formStyle(.columns) .padding(.horizontal, 16) .padding(.vertical, 16) Spacer() } } The key is .formStyle(.columns).
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’25
Reply to vLookup In App?
I suspect that the reason no one has responded is that your question is cast in terms of spreadsheets, which are a bit hard to grok when you’re used to traditional programming languages. So I dusted off my copy of Numbers and looked up the VLOOKUP function. It seems to be equivalent to Swift’s array subscripting. For example: let sheet: [[Int]] = [ [1, 2, 3], [4, 5, 6], [7, 8, 9], ] let row = 1 let column = 2 print(sheet[row][column]) // prints “6”If you read the documentation on arrays and subscripts, that might put you on the right path.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: Swift Tags:
Sep ’16
Reply to SwiftUI Table Limit of Columns?
I am attempting to overcome the 10 columns limitation of Table This is Crashing the compiler with this error: The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions Code: import SwiftUI //--------------------------------------------------------------------------------------------- struct TestStruct : Identifiable { var id = UUID () var name : String var val : Int } //--------------------------------------------------------------------------------------------- struct ContentView: View { @State var testData : [ TestStruct ] = [ TestStruct ( name: Leopold, val: 1 ), TestStruct ( name: Napoleon, val: 2 ) ] var body: some View { VStack { Table ( testData ) { Group { TableColumn ( Name ) { testStruct in Text ( testStruct.name ) } TableColumn ( Value ) { testStruct in Text ( String ( testStruct.val ) ) } } } } } } //--------------------------------------------------------------------------------------------- struct ContentView_Pr
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’22
Reply to Illegal NSTableViewDataSource
Hello Claude:See if the code you checked is the same as this because when I run it with changes I get the crash at line 12import Cocoa import CoreData class RegistrationReportsViewController: NSViewController { requiredinit?(coder aDecoder: NSCoder) { self.items = [] super.init(coder: aDecoder) } overridefunc viewDidLoad() { super.viewDidLoad() tableView.dataSource = self // Do this FIRST tableView.delegate = self showRegisteredStudents() // not needed, done in showRegisteredStudents } privatelazyvar fetchedResultsController: NSFetchedResultsController = { let fetchRequest: NSFetchRequest = Registration.fetchRequest() let frc = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: self.persistentContainer.viewContext, sectionNameKeyPath: nil, cacheName: nil) frc.delegate = (selfas! NSFetchedResultsControllerDelegate) return frc }() var items: [NSManagedObject] var managedObjectContext = (NSApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext let persistentContain
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’20
Reply to Extra argument in call
Try this: let columns: [GridItem] = [GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible())] struct ContentView: View { var body: some View { GeometryReader { geometry in VStack{ Spacer() ZStack { LazyVGrid(columns: columns) { Group { Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) } Group { Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Cir
Dec ’21
Reply to How To Renew IOS Developer Certificate
You need to click on a specific profile, then click Edit. The available certificates should be shown at the bottom with radio buttons to choose the one you want. If it doesn't show up, are you sure you created an In House and Ad Hoc certificate and not a Development certificate? On the main Certificates page, the TYPE column should show iOS Distribution.
Jul ’20
Reply to Illegal NSTableViewDataSource
Yes, but what is the backtrace of the error ?What are the results of the print statements ?It seems that func tableView(_ tableView: NSTableView, objectValueFor tableColumn: NSTableColumn?, row: Int) -> Any? {is declared inside func configureCell(cell: NSTableCellView, row: Int, column: Int){which is not normalProbably miss a closing curly brace line 94.
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’20