Post

Replies

Boosts

Views

Activity

Reply to XCODE about distribute MINI6?
My guess is Xcode 11.4 does not support iOS devices introduced after Xcode 11.4's release, which was March 24, 2020. The iPad Mini 6 came out in 2021. Do you have another iOS device introduced after March 2020 to test my guess? You most likely need to update to a newer Xcode version to install your app on the iPad Mini 6.
Nov ’21
Reply to Xcode Single Executable File in C
If you are writing lots of small programs for a C programming course, you are better off using a text editor like VSCode, Sublime Text, BBEdit, or TextMate to write your code instead of Xcode. Xcode requires a project to create an executable file. You can't just create a C file in Xcode and run it. I know TextMate has a C bundle that lets you run your programs from inside TextMate by choosing Bundle > C > Run. I'm sure the other text editors I mentioned have ways to run your programs from the editor.
Nov ’21
Reply to Search path problem with XCode 9.4.1
Xcode has a Search Paths collection of build settings where you can add search paths for headers and libraries. Select the project file from the project navigator on the left side of the project window to open the project editor. Select the project from the left side of the project editor. Click the Build Settings button on the top of the project editor to access the build settings. Entering Search Paths in the search field will show the Search Paths collection.
Nov ’21
Reply to Enable access to Documents Directory in Xcode 13
The material in the url(for:in:appropriateFor:create:) docs provided the solution. The file permission problem was caused by the temporary file wrapper being in the same folder as the published book, The solution is to create a temporary directory for the file wrapper. Here's the code for anyone else who may have the same problem in the future. var wrapperURL = URL(string: "/") do { wrapperURL = try FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true) wrapperURL?.appendPathComponent("TempBook") } catch { Swift.print("Error creating a temporary URL for the file wrapper. Error: \(error)") }
Topic: Code Signing SubTopic: General Tags:
Sep ’21
Reply to Enable access to Documents Directory in Xcode 13
I took another look at my code and realized why I need the following code: var wrapperURL = location wrapperURL.deleteLastPathComponent() wrapperURL.appendPathComponent(location.lastPathComponent .replacingOccurrences(of: ".epub", with: "")) When someone chooses to publish the book, I get the location to publish the book from the file exporter or save panel. The URL will look similar to the following: /path/to/MyBook.epub When I write the file wrapper to disk, I can't write the wrapper at the location variable's URL because location is the destination for creating the book's Zip archive. I have to temporarily create the file wrapper with a different file name than MyBook.epub. /path/to/MyBook The MyBook file wrapper is the source for creating the Zip archive and MyBook.epub is the destination. I need both files to create the Zip archive with the ZIPFoundation framework. You said in an earlier post: When the user chooses a file in a standard file panel, the system extends your sandbox to access just that file. If you move the extension that’s a different file and you don’t have access to it. Does this mean my creating the temporary file wrapper is forbidden in the App Sandbox? For now I can avoid using the App Sandbox, but these permission errors also occur with the App Sandbox turned off.
Topic: Code Signing SubTopic: General Tags:
Sep ’21
Reply to Can I use Xcode for python?
It is possible to use Xcode for Python. Create an external build system project and enter the path to the Python interpreter in the Build Tool text field in the New Project Assistant. Xcode has support for Python syntax highlighting. I'm not sure if Xcode supports Python autocomplete. You're better off using a text editor like BBEdit, Sublime Text, TextMate, or VSCode for Python. Xcode is designed for making apps in Swift and Objective-C, not for Python development.
Sep ’21
Reply to Enable access to Documents Directory in Xcode 13
When I try the code you suggested. try "Hello Cruel World!".write(to: wrapperURL, atomically: false, encoding: .utf8) I get the permission error. However, I was inaccurate in my comment about wrapperURL. The wrapperURL variable removes the .epub extension from the location URL from the file exporter or save panel. // location is the URL from the file exporter or NSSavePanel. var wrapperURL = location wrapperURL.deleteLastPathComponent() wrapperURL.appendPathComponent(location.lastPathComponent .replacingOccurrences(of: ".epub", with: "")) When I replace wrapperURL with location in your example, the file permissions error goes away. try "Hello Cruel World!".write(to: location, atomically: false, encoding: .utf8) If I write the wrapper using the location, try mainDirectory.write(to: location, options: [], originalContentsURL: nil) The file permissions error goes away, but the file wrapper is empty.
Topic: Code Signing SubTopic: General Tags:
Sep ’21
Reply to Enable access to Documents Directory in Xcode 13
What I am trying to do is export a collection of Markdown files into an EPUB book. To create the EPUB book I start by creating a file wrapper that has everything the EPUB needs. I finish by using the ZIPFoundation framework to compress the file wrapper into a valid EPUB/Zip archive. When I finish building the file wrapper, I call the FileWrapper class's write function to temporarily create the file so ZIPFoundation can compress and archive it. do { // mainDirectory is the file wrapper root. wrapperURL is the location to export // from either the file exporter panel or NSSavePanel. try mainDirectory.write(to: wrapperURL, options: [], originalContentsURL: nil) } catch { Swift.print("Error temporarily writing the book's file wrapper to disk. Error: \(error)") } When I step through this code in the debugger, it goes to the catch block and prints the following message in the console: Error: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file TestBook in the location (path to folder inside the Documents directory)." This error occurs both with the SwiftUI file exporter and NSSavePanel. The only way I can get the error message to go away is to turn on the App Sandbox, give the Downloads folder read/write access, and export my books in the Downloads folder.
Topic: Code Signing SubTopic: General Tags:
Sep ’21
Reply to SwiftUI on MacOS (Not iOS)
The closest thing SwiftUI has out of the box is a document tab bar. If you create a document-based app, you get a tab bar with a tab for every open document and an X button to close the document. The tab bar is initially hidden. Choose View > Show Tab Bar to show the tab bar.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’21