Post

Replies

Boosts

Views

Activity

SQLite can't create database outside of "Application Support"
I have an application that takes XML data and converts it into database tables. It uses SQLite3 and SQLCipher. If I hard code the path to save the database to put it in my Application Support folder, it works perfectly -- creates the file (with [fm createFileAtPath: newPath contents: nil attributes: nil];) and then opens it with SQLite, it creates the tables and populates them, everything works as expected. If, however, I allow the user to save the database in the location of their choice, say in Documents or Downloads, the application creates the file (with createFileAtPath) but then when SQLite tries to create the tables, it fails with the error "unable to open database file" and error code 14 (which is a generic "couldn't open database" error.) Looking in the save directory, there is now a zero bytes file in that location. Everything that I've seen online indicates that this is a permissions/security issue, but no one seems to point to a solution -- I went so far as to put in code to run chmod on the database and the folder that it's in, even that didn't help. Your input is very much appreciated!
2
0
428
Jan ’24
Upgraded to Xcode 13 and Big Sur and now I can't build my project
As noted in the title, I've gone to Big Sur and Xcode 13, and now when I try to build a project that worked in Xcode 12, it fails with the error "File not found: /usr/lib/libstdc++.6.dylib for architecture x86_64" in the linker phase. After doing some reading, this appears to be a result of Apple dropping support for GCC in favor of LLVM, only problem is that I've selected "Compiler Default" for C and C++ language dialects, as well as explicitly setting C++ Standard Library to libc++, so I don't know why it's trying to link against libstdc++ (I looked at the Build Phases, and there's nothing in there related to libstdc++ that I can see.) About the only thing that I can think of is other binary code in the project, which is a separate application and two dynamic libraries -- I rebuilt the application and one of the libraries (I don't have the ability to rebuild the other library, as it is from a third party,) making sure that there was nothing associated with GCC, and I'm still getting the same error. Of course, I have cleaned the project, quit and restarted Xcode, rebooted, etc, and the problem persists. Short of starting a new project and rebuilding the existing one in a "clean" setting, I have no idea what to do about getting this project working again. I was able to move another Objective-C project to the new computer and it builds just fine. Any insights into what to look at in my project settings would be appreciated. Alternatively, I could copy libstdc++.6.0.9.dylib into /usr/lib/ (I have a copy from a previous installation,) but I've spent the day trying to figure out how to do that, without success -- csrutil disable and csrutil authenticated-root disable and logging in as root accomplished nothing. It's ridiculous that they've made it impossible for me to intentionally add a file to a computer that I own and physically possess, but I guess that's the way it is. Thanks!
3
0
2.8k
Sep ’21
Example of NSTableView with NSButtonCell with checkbox in Swift?
This seems like really basic functionality, but I'm pulling my hair out trying to find a good example in Swift. Problem: Everything that I've read, and seen examples in Objective-C, you set the state of the checkboxes in the "objectValueFor" datasource method by returning a 1 for state on, and 0 for state off, but it's not working.          func tableView(_ tableView: NSTableView,              objectValueFor tableColumn: NSTableColumn?,                         row: Int) -> Any? {                  if (tasks == nil) || (tableColumn == nil) {             return 0         }         let taskName = tasks!.tasks[row].name         for assignedTask in assignedTasks! {             if (assignedTask == taskName) {                 return 1             }         }         return 0     } If I set the state of the checkbox in the XIB to on, all of them are turned on, regardless of the if statement, and if I set the state in the XIB to off, they're all turned off, again regardless of the if statement, meaning that, although this function is being called, its return value is being ignored. Thanks for any help! Just a pointer to a good example of a checkbox in a NSButtonCell, written in Swift, would be well appreciated -- the one I found on Apple's website (the "iSpend" project) is so old it can't be opened by Xcode 12.
0
0
473
Sep ’21