Post

Replies

Boosts

Views

Activity

Reply to ld: symbol(s) not found for architecture x86_64
Please list the steps in detail on what you did to create the code and compile it. The information you provided isn't enough for people to answer your question. Providing more details on what you did to create the code and compile it will give people here a chance to give you a helpful answer. You tagged your question as Xcode, but your screenshot looks like Visual Studio Code. Did you create a project in Xcode or create a C++ file in Visual Studio Code? Does you MacBook have an Intel processor or an Apple Silicon (M1 or M2 chip)? The linker error says it can't find a main function for the Intel architecture.
May ’23
Reply to SwiftUI
The usual cause of the "Closure containing a declaration cannot be used with result builder ViewBuilde" error is doing something besides showing views inside the body of a SwiftUI view. If you do something like declare a function or make a network call inside the body of a SwiftUI view, you will get this error. If you want a fix for the error, show the code for the SwiftUI view where you get this error. Without that code, no one can tell you the mistake you made that caused the error or tell you what you need to do to fix the error.
Topic: Programming Languages SubTopic: Swift Tags:
May ’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:
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