Post

Replies

Boosts

Views

Activity

Reply to NavigationSplitView & CoreData Generating an error when adding first entity
Show the code where you add the entity. If you want to see whether the issue is with the split view, create a list that just shows the items and add a way to add new items. If you still have problems, you know the split view isn't causing the problems. Also see the following Stack Overflow question: https://stackoverflow.com/questions/73028881/swiftui-list-crashes-when-adding-items-on-macos
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’23
Reply to How do I edit default C++ file templates for Xcode?
Apple's C++ templates are at the following path: /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates/MultiPlatform/Source You should create a custom file template instead of editing the templates in the Xcode app bundle. Copy the C++ file template from Xcode to the path for custom templates. ~/Library/Developer/Xcode/Templates/File Templates You'll probably want to create another folder to hold your custom templates. The following article shows you how to create a custom file template for Xcode: http://www.popcornomnom.com/create-custom-xcode-file-template-for-ios-and-macos-swift-5/ If that article is too complicated, do a search for creating custom Xcode file templates in a search engine. That will give you multiple articles on creating file templates.
Topic: App & System Services SubTopic: Core OS Tags:
May ’23
Reply to NSUnknownKeyException when connecting property IB
Is there a reason you are using a xib file and an IBOutlet to show a single label? It would be easier to create the label in code inside the makeUIView function. If you have a more complex view that requires a xib file or storyboard, use UIViewControllerRepresentable to create a view controller instead of using UIViewRepresentable for a single UI view.
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’23
Reply to Cannot convert value of type in extension
Xcode's compiler should provide a fix for you if you click the button for the error in the source code editor and click the Fix button. The fix is to create a Double value from the precisionNumber constant to use for multiplying and dividing. value *= Double(precisionNumber) value /= Double(precisionNumber)
Topic: App & System Services SubTopic: General Tags:
May ’23
Reply to XCode 14.2 add MacOS 12. How?
You don't need to install the macOS 12 SDK to use the package. The package will work with the macOS 13 SDK that ships with Xcode 14. The macOS(.v12) listing you showed means the package requires macOS 12 or higher. The package won't run on macOS 11, but it will run on macOS 13.
May ’23
Reply to Files not showing up in Documents
Years ago I had a similar issue when I saved documents on a device where I hadn't ever saved a document on that device. The workaround was to create and save a document in one of Apple's iWork apps: Pages or Numbers. After doing that the documents I saved in the app I was developing appeared in the document list.
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’23
Reply to Xcode won't open
Before you trash Xcode 14.3, copy the iOS 16.4 support files to your Xcode 14.2 install. That will let you debug on your iOS 16.4 device with Xcode 14.2. You may find the following thread helpful: https://forums.macrumors.com/threads/xcode-14-2-14c18-breaks-with-ios-16-4-iphone-14-13-12-pro-iphonex-failed-to-prepare-device-for-development-after-os-ios-updates.2385046/ And you may find the following article helpful: https://www.swiftdevjournal.com/dealing-with-failed-to-prepare-device-for-development-error-message-in-xcode/
Mar ’23
Reply to iCloud Drive Corrupting Xcode Projects
Don't store your Xcode projects on iCloud Drive. If you want an online backup of your projects, use version control and a service like GitHub, Bitbucket, or GitLab. The following article shows you how to put an Xcode project on GitHub, Bitbucket, or GitLab: https://www.swiftdevjournal.com/putting-your-xcode-project-on-github-bitbucket-or-gitlab/
Mar ’23
Reply to Cannot find 'actionName' in scope
It appears your postMethodCall function takes three arguments: controllerName, actionName, and httpBody. When you make the call you have to place a colon, : after each argument name. You have commas after the controllerName and actionName arguments. Replace the commas with colons. APIWrapper.postMethodCall(controllerName: "juniorDoctor", actionName: "jnrsignup", httpBody: data) If that doesn't fix the compiler error, you will have to supply the signature of the postMethodCall function so we can see what the arguments are. For future reference, place your code listings in a code block instead of showing a screenshot of your Xcode window. Code in an image is much more difficult to read and can't be copied and pasted, reducing the chances of people answering your question.
Topic: App & System Services SubTopic: Core OS Tags:
Mar ’23
Reply to Import large C project into Xcode 14
One potential problem with using Xcode for this project is the open source project may not support Xcode project files. You would have to create a new project in Xcode and add the files from the open source project to the Xcode project. You may have problems pushing your changes to the open source project because of the Xcode project file. If you use a text editor like Visual Studio Code, Sublime Text, BBEdit, or TextMate, you wouldn't have to deal with Xcode project files. If you decide to use Xcode, start by creating an External Build System project in Xcode. The External Build System project is in the Other section of the New Project Assistant. Creating an External Build System project will give you an Xcode project that uses make as the build tool if you follow the defaults. After creating the project add the files from the open source project to your project. You can either drag the folders in the project to the Xcode project or choose File > Add Files to ProjectName in Xcode.
Feb ’23
Reply to Xcode Thread 1: signal SIGABRT
If you want to make a game, I recommend using a game engine like Unity or Godot or using Apple's SpriteKit framework. Use a game engine if you want your game to run on non-Apple platforms. If you really want to use SDL in Xcode, start over by creating a new project. Your screenshot shows a command-line tool project. The problem with a command-line tool project on Mac is that it doesn't create an app bundle for the game. Creating an app bundle makes it easier to load graphics, sounds, and other files in your game code. According to the SDL Mac instructions on their GitHub page, https://github.com/libsdl-org/SDL/blob/main/docs/README-macos.md The Mac download of SDL includes Xcode project templates. Install the templates and use them to create the Xcode project. The link also has instructions on how to set up a new project by hand.
Feb ’23
Reply to NavigationSplitView & CoreData Generating an error when adding first entity
Show the code where you add the entity. If you want to see whether the issue is with the split view, create a list that just shows the items and add a way to add new items. If you still have problems, you know the split view isn't causing the problems. Also see the following Stack Overflow question: https://stackoverflow.com/questions/73028881/swiftui-list-crashes-when-adding-items-on-macos
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to How do I edit default C++ file templates for Xcode?
Apple's C++ templates are at the following path: /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates/MultiPlatform/Source You should create a custom file template instead of editing the templates in the Xcode app bundle. Copy the C++ file template from Xcode to the path for custom templates. ~/Library/Developer/Xcode/Templates/File Templates You'll probably want to create another folder to hold your custom templates. The following article shows you how to create a custom file template for Xcode: http://www.popcornomnom.com/create-custom-xcode-file-template-for-ios-and-macos-swift-5/ If that article is too complicated, do a search for creating custom Xcode file templates in a search engine. That will give you multiple articles on creating file templates.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to NSUnknownKeyException when connecting property IB
Is there a reason you are using a xib file and an IBOutlet to show a single label? It would be easier to create the label in code inside the makeUIView function. If you have a more complex view that requires a xib file or storyboard, use UIViewControllerRepresentable to create a view controller instead of using UIViewRepresentable for a single UI view.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to Cannot convert value of type in extension
Xcode's compiler should provide a fix for you if you click the button for the error in the source code editor and click the Fix button. The fix is to create a Double value from the precisionNumber constant to use for multiplying and dividing. value *= Double(precisionNumber) value /= Double(precisionNumber)
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to XCode 14.2 add MacOS 12. How?
You don't need to install the macOS 12 SDK to use the package. The package will work with the macOS 13 SDK that ships with Xcode 14. The macOS(.v12) listing you showed means the package requires macOS 12 or higher. The package won't run on macOS 11, but it will run on macOS 13.
Replies
Boosts
Views
Activity
May ’23
Reply to Files not showing up in Documents
Years ago I had a similar issue when I saved documents on a device where I hadn't ever saved a document on that device. The workaround was to create and save a document in one of Apple's iWork apps: Pages or Numbers. After doing that the documents I saved in the app I was developing appeared in the document list.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to oh no, what do I do now? ios 16.4.1 .... imac 2014
You can't downgrade your phone. You can install support files for iOS 16.4 to be able to debug your project on Xcode 12. Read the following article for more detailed information: https://www.swiftdevjournal.com/dealing-with-failed-to-prepare-device-for-development-error-message-in-xcode/
Replies
Boosts
Views
Activity
Apr ’23
Reply to How can you convert Xcode (SwiftUI) file to .swiftpm?
Create a Swift Playgrounds App project in Xcode if you want to use the project in the Swift Playgrounds app on iPad. You can find more detailed information in the following article: https://www.swiftdevjournal.com/working-on-a-swiftui-project-in-xcode-and-swift-playgrounds/
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to Xcode won't open
Before you trash Xcode 14.3, copy the iOS 16.4 support files to your Xcode 14.2 install. That will let you debug on your iOS 16.4 device with Xcode 14.2. You may find the following thread helpful: https://forums.macrumors.com/threads/xcode-14-2-14c18-breaks-with-ios-16-4-iphone-14-13-12-pro-iphonex-failed-to-prepare-device-for-development-after-os-ios-updates.2385046/ And you may find the following article helpful: https://www.swiftdevjournal.com/dealing-with-failed-to-prepare-device-for-development-error-message-in-xcode/
Replies
Boosts
Views
Activity
Mar ’23
Reply to iCloud Drive Corrupting Xcode Projects
Don't store your Xcode projects on iCloud Drive. If you want an online backup of your projects, use version control and a service like GitHub, Bitbucket, or GitLab. The following article shows you how to put an Xcode project on GitHub, Bitbucket, or GitLab: https://www.swiftdevjournal.com/putting-your-xcode-project-on-github-bitbucket-or-gitlab/
Replies
Boosts
Views
Activity
Mar ’23
Reply to SwiftUI, how to use Commands in a document based App
Look into focused values and focused bindings. That's how menus in SwiftUI apps access the document. The following articles may help you: https://www.swiftdevjournal.com/accessing-the-document-in-a-swiftui-menu/ https://troz.net/post/2021/swiftui_mac_menus/
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to Cannot find 'actionName' in scope
It appears your postMethodCall function takes three arguments: controllerName, actionName, and httpBody. When you make the call you have to place a colon, : after each argument name. You have commas after the controllerName and actionName arguments. Replace the commas with colons. APIWrapper.postMethodCall(controllerName: "juniorDoctor", actionName: "jnrsignup", httpBody: data) If that doesn't fix the compiler error, you will have to supply the signature of the postMethodCall function so we can see what the arguments are. For future reference, place your code listings in a code block instead of showing a screenshot of your Xcode window. Code in an image is much more difficult to read and can't be copied and pasted, reducing the chances of people answering your question.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to Xcode 14 Source Control Operation Failed
Do you have a file named Models in your project? Or is this a new file someone else created and placed on GitHub. The answer to the following Stack Overflow question may solve your problem: https://stackoverflow.com/questions/29287734/how-to-pull-new-files-from-git-master
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to Import large C project into Xcode 14
One potential problem with using Xcode for this project is the open source project may not support Xcode project files. You would have to create a new project in Xcode and add the files from the open source project to the Xcode project. You may have problems pushing your changes to the open source project because of the Xcode project file. If you use a text editor like Visual Studio Code, Sublime Text, BBEdit, or TextMate, you wouldn't have to deal with Xcode project files. If you decide to use Xcode, start by creating an External Build System project in Xcode. The External Build System project is in the Other section of the New Project Assistant. Creating an External Build System project will give you an Xcode project that uses make as the build tool if you follow the defaults. After creating the project add the files from the open source project to your project. You can either drag the folders in the project to the Xcode project or choose File > Add Files to ProjectName in Xcode.
Replies
Boosts
Views
Activity
Feb ’23
Reply to Xcode Thread 1: signal SIGABRT
If you want to make a game, I recommend using a game engine like Unity or Godot or using Apple's SpriteKit framework. Use a game engine if you want your game to run on non-Apple platforms. If you really want to use SDL in Xcode, start over by creating a new project. Your screenshot shows a command-line tool project. The problem with a command-line tool project on Mac is that it doesn't create an app bundle for the game. Creating an app bundle makes it easier to load graphics, sounds, and other files in your game code. According to the SDL Mac instructions on their GitHub page, https://github.com/libsdl-org/SDL/blob/main/docs/README-macos.md The Mac download of SDL includes Xcode project templates. Install the templates and use them to create the Xcode project. The link also has instructions on how to set up a new project by hand.
Replies
Boosts
Views
Activity
Feb ’23