Post

Replies

Boosts

Views

Activity

Reply to Xcode unable to prepare iPhone for development
suddenly unable to connect Did the iPhone suddenly become unable to connect when you updated to iOS 15.3? Xcode does not work well with devices running a newer version of iOS than the SDK that comes with Xcode. Xcode 13.1 has the iOS 15.1 SDK. You are going to run into problems with iOS versions newer than iOS 15.1. Updating to the latest version of Xcode should enable you to run and debug your project on the iOS 15.3 device.
Mar ’22
Reply to Adding Source Control to an existing Xcode project
Back up your project before doing anything else so you have a copy to go back to in case things go wrong. In the Finder press Cmd-Shift-Period. Doing this will show hidden files and folders in the Finder. Pressing Cmd-Shift-Period a second time will hide the hidden files. Go inside your project folder. There should be a hidden folder with the name .git. That folder contains the git repository. The files and folders in your project must be in the same folder where the .git folder resides, the project folder, for git to track the files. DO NOT put your project files inside the .git folder. The left side of the project window has a list of the project's files. Do any of the files have a question mark next to them? If they do, select the file, right-click, and choose Source Control > Add Filename from the contextual menu to add the file to the repository. If the file has an A next to it in the project window, you will have to commit the file to finish adding the file to the repository. If none of the files have a question mark next to them, you're going to have to show the contents and structure of your project folder for anyone to solve the problem. Somehow the contents of your project are not inside the project folder. As a test I created an Xcode project without a git repository and added a git repository through Xcode's Source Control menu. The project file had a question mark next to it, and I added the file from the contextual menu.
Mar ’22
Reply to Xcode problems
You have a compiler error. No one can tell you how to correct the error until you show the compiler errors. Press Cmd-5 to show the issue navigator, which will show you the errors. Please post the errors as text instead of screenshots. Text is easier to read on these forums than text in screenshots. Judging by the questions you are asking here, you are new to iOS development with SwiftUI. Instead of asking questions on these forums every time you get a compiler error, you would get better results by taking Hacking with Swift's free 100 Days of SwiftUI course. https://www.hackingwithswift.com/100/swiftui The Hacking with Swift course is geared towards people new to iOS development. Plus the site has a forum dedicated to the course where you can ask questions if you run into problems with the projects in the course. They also have a forum for SwiftUI questions. The Hacking with Swift forums are focused on new developers more than these forums, which are meant for specific issues developers are having with Apple's frameworks and tools.
Mar ’22
Reply to Standalone OS-X App
You can create and distribute Mac apps without using the Mac App Store. Start by archiving the project by choosing Product > Archive. You can find the archive in the Organizer window by choosing Window > Organizer. Click the Distribute App button in the Organizer to distribute the app. For internal use choose Development as the distribution method. You could also choose Copy App as the distribution method and manually send the app to your group.
Topic: App & System Services SubTopic: Core OS Tags:
Mar ’22
Reply to Failed to prepare device for deployment
Is this error occurring because I am using Xcode 13.1 with iOS 15.4.1 and need to upgrage to Xcode 13.3 instead? Yes. The following article provides more details and workarounds if you're unable to update to Xcode 13.3: https://www.swiftdevjournal.com/dealing-with-failed-to-prepare-device-for-development-error-message-in-xcode/
Apr ’22
Reply to Can't run Swift App on Mojave
What type of Xcode project did you create? Xcode defaults to using SwiftUI for Mac App and Document App projects. SwiftUI projects will not run on macOS 10.14. When you choose App or Document App on a Mac project and click the Next button, make sure you choose either Storyboard or Xib from the Interface menu. Choosing Storyboard or Xib will create an AppKit project. With an AppKit project you can set the deployment target to macOS 10.14 and have the app run on macOS 10.14.
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’22
Reply to Can't run Swift App on Mojave
What architectures did you build for? What is the value of the Build Active Architecture setting? Judging by the problems you're having, it looks like you built for the active architecture only. If you click the Run button in Xcode's toolbar, Xcode is set to build a Debug build, which builds only for the active architecture. On an M1 Mac, building for the active architecture builds an app that won't run on Intel Macs. Any Mac running 10.14 isn't going to be able to run an M1 app. If you want your app to run on both M1 and Intel Macs, take the following steps: Choose Product > Archive to build and archive this project. This will create a universal binary that runs on both M1 and Intel Macs. Open the Organizer by choosing Window > Organizer. Select your archive from the list in the Organizer. Click the Distribute App button on the right side of the Organizer. Choose Copy App as the method of distribution. Click the Next button. Choose a location to store the exported app. Click the Export button. Now you should be able to copy the app to the older Mac and run it. You might have to bypass macOS's Gatekeeper security to launch the app because of choosing Copy App instead of Developer ID as the method of distribution. If the app still doesn't run on the older Mac, make sure you set the deployment target for both the project and the app target. If that doesn't work, I have nothing else to suggest.
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’22
Reply to SwiftUI NSOpenPanel runs but then crashes Mac app
The fileOpenDialog function returns an array of optional URLs. What does that function return when you call it? The following line is going to crash if the array is empty: var csvURLString = fileOpenDialog()[0]?.path SwiftUI has a fileImporter modifier that shows an Open panel so you can avoid using NSOpenPanel. Searching for swiftui fileimporter in a search engine brings up several articles on using the file importer. If you still want to use NSOpenPanel with SwiftUI, the following article may help you: https://serialcoder.dev/text-tutorials/macos-tutorials/save-and-open-panels-in-swiftui-based-macos-apps/
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’22
Reply to Do I have to be a paid developer to develop MacOS programs for personal use?
You do not need a paid developer account to develop Mac apps for personal use. You need a paid account to do the following: Submit an app to the Mac App Store Use Apple capabilities like iCloud and Game Center Sign and notarize your app with a developer ID to work with Apple's Gatekeeper feature Gatekeeper makes it painful to open apps that aren't notarized. Without a paid developer account you won't be able to notarize your apps. Your options are to rebuild the apps periodically or bypass Gatekeeper. The following article shows how to bypass Gatekeeper for a single app: https://disable-gatekeeper.github.io
Topic: Code Signing SubTopic: General Tags:
May ’22
Reply to About page
Is this for iOS or Mac? For Mac I can answer. In Xcode choose File > New > File and add a RTF file to your project. Name the file Credits.rtf. Edit the files with what you want to appear in the About box. You can find additional information in the following article: https://www.swiftdevjournal.com/customizing-the-about-box-in-your-mac-app/
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’22
Reply to Xcode unable to prepare iPhone for development
suddenly unable to connect Did the iPhone suddenly become unable to connect when you updated to iOS 15.3? Xcode does not work well with devices running a newer version of iOS than the SDK that comes with Xcode. Xcode 13.1 has the iOS 15.1 SDK. You are going to run into problems with iOS versions newer than iOS 15.1. Updating to the latest version of Xcode should enable you to run and debug your project on the iOS 15.3 device.
Replies
Boosts
Views
Activity
Mar ’22
Reply to Adding Source Control to an existing Xcode project
Back up your project before doing anything else so you have a copy to go back to in case things go wrong. In the Finder press Cmd-Shift-Period. Doing this will show hidden files and folders in the Finder. Pressing Cmd-Shift-Period a second time will hide the hidden files. Go inside your project folder. There should be a hidden folder with the name .git. That folder contains the git repository. The files and folders in your project must be in the same folder where the .git folder resides, the project folder, for git to track the files. DO NOT put your project files inside the .git folder. The left side of the project window has a list of the project's files. Do any of the files have a question mark next to them? If they do, select the file, right-click, and choose Source Control > Add Filename from the contextual menu to add the file to the repository. If the file has an A next to it in the project window, you will have to commit the file to finish adding the file to the repository. If none of the files have a question mark next to them, you're going to have to show the contents and structure of your project folder for anyone to solve the problem. Somehow the contents of your project are not inside the project folder. As a test I created an Xcode project without a git repository and added a git repository through Xcode's Source Control menu. The project file had a question mark next to it, and I added the file from the contextual menu.
Replies
Boosts
Views
Activity
Mar ’22
Reply to Xcode problems
You have a compiler error. No one can tell you how to correct the error until you show the compiler errors. Press Cmd-5 to show the issue navigator, which will show you the errors. Please post the errors as text instead of screenshots. Text is easier to read on these forums than text in screenshots. Judging by the questions you are asking here, you are new to iOS development with SwiftUI. Instead of asking questions on these forums every time you get a compiler error, you would get better results by taking Hacking with Swift's free 100 Days of SwiftUI course. https://www.hackingwithswift.com/100/swiftui The Hacking with Swift course is geared towards people new to iOS development. Plus the site has a forum dedicated to the course where you can ask questions if you run into problems with the projects in the course. They also have a forum for SwiftUI questions. The Hacking with Swift forums are focused on new developers more than these forums, which are meant for specific issues developers are having with Apple's frameworks and tools.
Replies
Boosts
Views
Activity
Mar ’22
Reply to "Failed to prepare device for development." with Xcode 13.2.1 and iOS 15.4 device
You need to update to Xcode 13.3 to run and debug projects on a device running iOS 15.4. The following article has a more detailed explanation: https://www.swiftdevjournal.com/dealing-with-failed-to-prepare-device-for-development-error-message-in-xcode/
Replies
Boosts
Views
Activity
Mar ’22
Reply to Standalone OS-X App
You can create and distribute Mac apps without using the Mac App Store. Start by archiving the project by choosing Product > Archive. You can find the archive in the Organizer window by choosing Window > Organizer. Click the Distribute App button in the Organizer to distribute the app. For internal use choose Development as the distribution method. You could also choose Copy App as the distribution method and manually send the app to your group.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Mar ’22
Reply to Prevent Save Panel in SwiftUI Mac app from saving as file type my app exports
I don't make any explicit call in my code to open the Save panel to save the document. It's the standard SwiftUI code where choosing File > Save opens the Save panel. I use fileExporter to export the document. I set the content type for the file exporter to the exported file type.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’22
Reply to Failed to prepare device for deployment
Is this error occurring because I am using Xcode 13.1 with iOS 15.4.1 and need to upgrage to Xcode 13.3 instead? Yes. The following article provides more details and workarounds if you're unable to update to Xcode 13.3: https://www.swiftdevjournal.com/dealing-with-failed-to-prepare-device-for-development-error-message-in-xcode/
Replies
Boosts
Views
Activity
Apr ’22
Reply to Can't run Swift App on Mojave
What type of Xcode project did you create? Xcode defaults to using SwiftUI for Mac App and Document App projects. SwiftUI projects will not run on macOS 10.14. When you choose App or Document App on a Mac project and click the Next button, make sure you choose either Storyboard or Xib from the Interface menu. Choosing Storyboard or Xib will create an AppKit project. With an AppKit project you can set the deployment target to macOS 10.14 and have the app run on macOS 10.14.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Apr ’22
Reply to Can't run Swift App on Mojave
What architectures did you build for? What is the value of the Build Active Architecture setting? Judging by the problems you're having, it looks like you built for the active architecture only. If you click the Run button in Xcode's toolbar, Xcode is set to build a Debug build, which builds only for the active architecture. On an M1 Mac, building for the active architecture builds an app that won't run on Intel Macs. Any Mac running 10.14 isn't going to be able to run an M1 app. If you want your app to run on both M1 and Intel Macs, take the following steps: Choose Product > Archive to build and archive this project. This will create a universal binary that runs on both M1 and Intel Macs. Open the Organizer by choosing Window > Organizer. Select your archive from the list in the Organizer. Click the Distribute App button on the right side of the Organizer. Choose Copy App as the method of distribution. Click the Next button. Choose a location to store the exported app. Click the Export button. Now you should be able to copy the app to the older Mac and run it. You might have to bypass macOS's Gatekeeper security to launch the app because of choosing Copy App instead of Developer ID as the method of distribution. If the app still doesn't run on the older Mac, make sure you set the deployment target for both the project and the app target. If that doesn't work, I have nothing else to suggest.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Apr ’22
Reply to MacOS cannot open an app project with this version of Swift Playgrounds.
The Mac version of Swift Playgrounds currently does not support Xcode's Swift Playgrounds App project. Use the iPad version of Swift Playgrounds to work on your app project in Swift Playgrounds.
Replies
Boosts
Views
Activity
Apr ’22
Reply to Eligibility regarding Apple Developer Program if I'm under 18
You can't sign up for the paid Apple Developer Program if you are under 18. To register for free as an Apple developer, take the following steps: Go to Apple's Developer home page. Click the Account link at the top of the page. Sign in with your Apple ID.
Replies
Boosts
Views
Activity
Apr ’22
Reply to Are there any developer meetings near Columbus / Dayton Ohio?
Check Meetup for local developers groups. I found the Buckeye Cocoa Meetup group in Columbus. https://www.meetup.com/Buckeye-Cocoa I also found Cincinnati CocoaHeads. https://www.meetup.com/CincyCocoaDev/
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to SwiftUI NSOpenPanel runs but then crashes Mac app
The fileOpenDialog function returns an array of optional URLs. What does that function return when you call it? The following line is going to crash if the array is empty: var csvURLString = fileOpenDialog()[0]?.path SwiftUI has a fileImporter modifier that shows an Open panel so you can avoid using NSOpenPanel. Searching for swiftui fileimporter in a search engine brings up several articles on using the file importer. If you still want to use NSOpenPanel with SwiftUI, the following article may help you: https://serialcoder.dev/text-tutorials/macos-tutorials/save-and-open-panels-in-swiftui-based-macos-apps/
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to Do I have to be a paid developer to develop MacOS programs for personal use?
You do not need a paid developer account to develop Mac apps for personal use. You need a paid account to do the following: Submit an app to the Mac App Store Use Apple capabilities like iCloud and Game Center Sign and notarize your app with a developer ID to work with Apple's Gatekeeper feature Gatekeeper makes it painful to open apps that aren't notarized. Without a paid developer account you won't be able to notarize your apps. Your options are to rebuild the apps periodically or bypass Gatekeeper. The following article shows how to bypass Gatekeeper for a single app: https://disable-gatekeeper.github.io
Topic: Code Signing SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to About page
Is this for iOS or Mac? For Mac I can answer. In Xcode choose File > New > File and add a RTF file to your project. Name the file Credits.rtf. Edit the files with what you want to appear in the About box. You can find additional information in the following article: https://www.swiftdevjournal.com/customizing-the-about-box-in-your-mac-app/
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’22