Post

Replies

Boosts

Views

Activity

Reply to Problems using Core data.
When you create a new Core Data project in Xcode, the project is set to automatically create subclasses for your Core Data entities when you build the project. When you create a NSManagedObject subclass manually, you now have two copies of the subclass: the one Xcode generates and the one you created. You can have only one copy of the subclass. To fix the problem either remove the NSManagedObject subclass files you created or tell Xcode not to generate subclasses for your entities. Read the following article for more details: https://www.swiftdevjournal.com/core-data-code-generation/
Nov ’23
Reply to Move project to older Xcode version
You already did what most people would suggest first, make sure the project format is set to a version that will open in an older version of Xcode. That is going to make finding a solution tougher so you have to provide more details for anyone to help you. List the steps you took to create the project in Xcode 15, and be specific and detailed. What type of project did you create?
Nov ’23
Reply to Document-based Apple App that can run on iOS, iPadOS, and macOS
Your project idea sounds overwhelming for a first project. I recommend starting with a simpler project before attempting this project. If you really want to do this project right now, start with one smaller part, such as editing HTML, and moving on to things like WYSIWYG editing, video, audio, and sharing documents with users later. Some technologies you need to learn to make this app include the following: SwiftUI for the user interface because you want the app to run on iOS and Mac. PDFKit for showing PDF files. TextKit, and the NSTextView and UITextView classes. SwiftUI's text editor is very limited and does not support WYSIWYG editing. You would have to subclass NSTextView and UITextView to do WYSIWYG editing. You might need to study AVFoundation for the video and audio files. You might find the following list of frameworks for text editing helpful: https://github.com/mattmassicotte/TextEditingReference
Topic: UI Frameworks SubTopic: AppKit Tags:
Nov ’23
Reply to Xcode 15.0 using macOS 10.14 SDK as Base SDK
Why do you need to use the macOS 10.14 SDK? If you want your app to run on macOS 10.14, set the deployment target for your app to 10.14, and you can use the macOS 14 SDK that ships with Xcode 15. By setting the deployment target to 10.14, your app will run on macOS 10.14 and above, assuming you aren't using any new technologies Apple added in later OS versions. Read the following article if you don't know how to change the deployment target. https://www.swiftdevjournal.com/supporting-older-versions-of-ios-and-macos/
Oct ’23
Reply to Combining SwiftUI & SpriteKit
I have not tried loading a SpriteKit scene from a .sks file to a SwiftUI sprite view so I don't have a specific solution for you. I have some tips and suggestions that may help you solve the problem yourself or give other people here enough information to help you. It works with some changes Show the code you use to declare the property for the scene in the SwiftUI view. I still can't interact with the MapScene Provide more details. What are you trying to do? What do you expect to happen? What happens? Set a breakpoint in your touchesBegan or mouseDown functions. If you run your project and tap or click in the scene, does the breakpoint fire? If you have not used Xcode's debugger before, read the following article: https://www.swiftdevjournal.com/an-introduction-to-xcodes-debugger/ I doubt you are the first person to have trouble loading a SpriteKit scene into a SwiftUI view. Search on Stack Overflow or a search engine, and chances are high someone has had the same problem and received a solution.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’23
Reply to Documentation for MACOSX_DEPLOYMENT_TARGET?
I found a mention of MACOSX_DEPLOYMENT_TARGET in Xcode's Build Setting Reference. https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW129 I created a new Mac app project in Xcode 14.2, and the project has a setting for the macOS deployment target, so I think the MACOSX_DEPLOYMENT_TARGET build setting is still used.
Topic: App & System Services SubTopic: Core OS Tags:
Oct ’23
Reply to fatal error: Index out of range...
What is golfDBdata? I don't see it declared in the code you showed. I assume it's an array. How many elements does it have? What is numDB? What is its value? The error message is telling you that the value of numDB is greater than or equal to the number of elements in golfDBdata. Another potential problem you have is you are running the code asynchronously. You may be trying to access data before it's been fetched.
Oct ’23
Reply to Combining SwiftUI & SpriteKit
It shows a black screen because you passed an empty scene to the sprite view. SpriteView(scene:MapScene()) Calling MapScene() creates an empty scene. You must add a property to your view that holds the scene to show in the sprite view. Call newGameScene to initialize it. @State var mapScene = MapScene.newGameScene() I haven't tested that line of code so you may have to make some changes to get it to work. But it gives you an idea of what you need to do. Pass that property to the sprite view. SpriteView(scene: mapScene)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’23
Reply to Can not test my app on my device because of version compatibility.
Either update to Xcode 15 or add the iOS 17 device files to your Xcode bundle. Read the following article for more details: https://www.swiftdevjournal.com/dealing-with-failed-to-prepare-device-for-development-error-message-in-xcode/
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’23
Reply to Problems using Core data.
When you create a new Core Data project in Xcode, the project is set to automatically create subclasses for your Core Data entities when you build the project. When you create a NSManagedObject subclass manually, you now have two copies of the subclass: the one Xcode generates and the one you created. You can have only one copy of the subclass. To fix the problem either remove the NSManagedObject subclass files you created or tell Xcode not to generate subclasses for your entities. Read the following article for more details: https://www.swiftdevjournal.com/core-data-code-generation/
Replies
Boosts
Views
Activity
Nov ’23
Reply to iOS xibs do not support target device type "mac"
It's been a while since I worked with xib files, but I doubt a single xib file would work on both iOS and Mac. You probably need to create new xib files for Mac.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Nov ’23
Reply to StoreKit fetching product using local config file returns empty array on Mac
What am I missing that is preventing me from fetching the products from my local StoreKit config file on Mac? I was missing a Mac build in TestFlight. Once I added a mac build in TestFlight and got the build approved for external testing, I was able to fetch the products on Mac.
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
Nov ’23
Reply to Move project to older Xcode version
You already did what most people would suggest first, make sure the project format is set to a version that will open in an older version of Xcode. That is going to make finding a solution tougher so you have to provide more details for anyone to help you. List the steps you took to create the project in Xcode 15, and be specific and detailed. What type of project did you create?
Replies
Boosts
Views
Activity
Nov ’23
Reply to Document-based Apple App that can run on iOS, iPadOS, and macOS
Your project idea sounds overwhelming for a first project. I recommend starting with a simpler project before attempting this project. If you really want to do this project right now, start with one smaller part, such as editing HTML, and moving on to things like WYSIWYG editing, video, audio, and sharing documents with users later. Some technologies you need to learn to make this app include the following: SwiftUI for the user interface because you want the app to run on iOS and Mac. PDFKit for showing PDF files. TextKit, and the NSTextView and UITextView classes. SwiftUI's text editor is very limited and does not support WYSIWYG editing. You would have to subclass NSTextView and UITextView to do WYSIWYG editing. You might need to study AVFoundation for the video and audio files. You might find the following list of frameworks for text editing helpful: https://github.com/mattmassicotte/TextEditingReference
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Nov ’23
Reply to Xcode 15.0 using macOS 10.14 SDK as Base SDK
Why do you need to use the macOS 10.14 SDK? If you want your app to run on macOS 10.14, set the deployment target for your app to 10.14, and you can use the macOS 14 SDK that ships with Xcode 15. By setting the deployment target to 10.14, your app will run on macOS 10.14 and above, assuming you aren't using any new technologies Apple added in later OS versions. Read the following article if you don't know how to change the deployment target. https://www.swiftdevjournal.com/supporting-older-versions-of-ios-and-macos/
Replies
Boosts
Views
Activity
Oct ’23
Reply to Selectively Removing Default Menu Bar Menus (like File, Edit, View, Window)
The answers to the following Stack Overflow question may help you: https://stackoverflow.com/questions/65209295/how-do-i-hide-default-commandmenu-in-swiftui-on-macos/70553784#70553784
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’23
Reply to Making an iOS app with Python Backend
You can use any backend you want in an iOS app, including a Python backend. I haven't used a Python backend in an iOS app so I can't provide more details on how to do it.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Oct ’23
Reply to Combining SwiftUI & SpriteKit
I have not tried loading a SpriteKit scene from a .sks file to a SwiftUI sprite view so I don't have a specific solution for you. I have some tips and suggestions that may help you solve the problem yourself or give other people here enough information to help you. It works with some changes Show the code you use to declare the property for the scene in the SwiftUI view. I still can't interact with the MapScene Provide more details. What are you trying to do? What do you expect to happen? What happens? Set a breakpoint in your touchesBegan or mouseDown functions. If you run your project and tap or click in the scene, does the breakpoint fire? If you have not used Xcode's debugger before, read the following article: https://www.swiftdevjournal.com/an-introduction-to-xcodes-debugger/ I doubt you are the first person to have trouble loading a SpriteKit scene into a SwiftUI view. Search on Stack Overflow or a search engine, and chances are high someone has had the same problem and received a solution.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’23
Reply to Documentation for MACOSX_DEPLOYMENT_TARGET?
I found a mention of MACOSX_DEPLOYMENT_TARGET in Xcode's Build Setting Reference. https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW129 I created a new Mac app project in Xcode 14.2, and the project has a setting for the macOS deployment target, so I think the MACOSX_DEPLOYMENT_TARGET build setting is still used.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Oct ’23
Reply to fatal error: Index out of range...
What is golfDBdata? I don't see it declared in the code you showed. I assume it's an array. How many elements does it have? What is numDB? What is its value? The error message is telling you that the value of numDB is greater than or equal to the number of elements in golfDBdata. Another potential problem you have is you are running the code asynchronously. You may be trying to access data before it's been fetched.
Replies
Boosts
Views
Activity
Oct ’23
Reply to Combining SwiftUI & SpriteKit
It shows a black screen because you passed an empty scene to the sprite view. SpriteView(scene:MapScene()) Calling MapScene() creates an empty scene. You must add a property to your view that holds the scene to show in the sprite view. Call newGameScene to initialize it. @State var mapScene = MapScene.newGameScene() I haven't tested that line of code so you may have to make some changes to get it to work. But it gives you an idea of what you need to do. Pass that property to the sprite view. SpriteView(scene: mapScene)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’23