Post

Replies

Boosts

Views

Activity

Reply to Adapting old C++ Code to run on MacOS
It's been 10+ years since I used SDL so I can't provide an answer to your specific question, but I can provide some help for you to accomplish your goal. File loading code from SDL articles and tutorials aren't going to work well on Mac because Mac apps have a different structure. Mac apps are app bundles that look like a single file in the Finder but have folders and files inside them. You can examine the contents of app bundles in the Finder by selecting a file, right-clicking, and choosing Show Package Contents. In a Mac game the sound and image files are in the app bundle. Windows and Linux do not have app bundles. If you use code to load a sound file, such as the following, in a Mac game: Mix_Chunk* sound = Mix_LoadWAV("sounds/rm1.wav"); The game won't be able to find and load the file. The big thing to get file loading to work properly with SDL on Mac is to create an Xcode project that creates an app bundle, not a command-line tool project. You may be able to find SDL Xcode project templates on GitHub or at the SDL site that take care of things for you. But you can also create an App project that uses Objective-C as the language and storyboards for the user interface. Delete the .m, .h, and storyboard files from the project. Add SDL and your C++ code. The following tutorial is old so the screenshots are going to look very different, but it shows how to set up SDL2 with Xcode: https://www.meandmark.com/blog/2012/01/using-sdl-with-xcode-4/ The following Reddit thread has a link to a newer article on using SDL with Xcode: https://www.reddit.com/r/Xcode/comments/zi9oku/how_do_i_set_up_sdl_with_xcode/
Dec ’22
Reply to Portrait only app for iPad
You can set the device orientations your app supports from Xcode's project editor. Open the project editor by selecting the project file from the left side of the project window. Select the app target from the target list on the left side of the project editor. Click the General button at the top of the project editor. Go to the Deployment Info section Select the checkboxes for the iPad orientations you want to support.
Topic: App & System Services SubTopic: Hardware Tags:
Dec ’22
Reply to Command SwiftCompile failed with a nonzero exit code
The error message says there was an error compiling your code. The actual errors should appear in the issue navigator (shown in your screenshot) or the report navigator (Press Cmd-9 to open). Your screenshot isn't showing any additional errors. If you choose Product > Clean Build Folder in Xcode and build the project, does the error go away? If not, do additional errors appear in the issue navigator? Did you make any changes in your code recently before building the project? For anyone to provide additional help, you need to provide more information on what you were doing before you got the error.
Topic: Programming Languages SubTopic: Swift Tags:
Dec ’22
Reply to unrecognized selector sent to instance
The problem is more likely to be in the storyboard than in the code you provided. What is the class name of the view controller in the storyboard's identity inspector? Choose View > Inspectors > Identity in Xcode to show the identity inspector. The class name in the storyboard needs to be the name of your view controller's class, ViewController in your code example. What is most likely happening is the view controller's class is UIViewController in the storyboard. UIViewController doesn't have a buttonPressed selector, ViewController does. If you change the name of the class to ViewController, the error should go away. Is the IBAction connected? There should be a filled-in circle next to the line of code in Xcode's editor. If the error persists, you will have to provide more information on how you set up your storyboard for anyone to help you.
Dec ’22
Reply to Aquestion About OS high sierra 10.13.6
You would not be able to submit apps to the App Store with macOS 10.13. Currently you need to use Xcode 13 to submit apps to the App Store. Xcode 13 requires macOS 11. Pretty soon this requirement will be bumped up to Xcode 14, which requires macOS 12. You listed macOS as a tag. With macOS 10.13 you could create Mac apps for people to download and install on your own site, bypassing the App Store.
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’23
Reply to View Controller File missing in Xcode 14
The most likely cause of your problem is that you did not explicitly specify the interface when creating the project. Xcode defaults to using SwiftUI for new projects. SwiftUI does not have view controllers. You must explicitly choose Storyboard from the Interface menu when creating the project to get a view controller file. The following article has more detailed information: https://www.swiftdevjournal.com/xcode-11-missing-view-controllers/
Topic: UI Frameworks SubTopic: UIKit Tags:
Jan ’23
Reply to MacOS SwiftUI app hangs after view creation
I've tried running instrumentation to figure out what is going on here, Do you mean you profiled the app with Instruments? If so, what templates did you use? I recommend profiling your app with Instruments. Choose Product > Profile in Xcode to profile with Instruments. The App Launch, SwiftUI, and Time Profiler Instruments templates will help you find what's taking so long. The App Launch should help if the slowness you're experiencing occurs when launching your app. You may also find the following article helpful: https://www.swiftdevjournal.com/finding-the-slow-spots-in-your-code-with-the-time-profiler-instrument/
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’23
Reply to Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
You are getting an error because displayLbl is an implicitly unwrapped optional whose value is nil. You declared the type to be UILabel!. By adding the ! character you set your app to crash if the outlet is nil and your code accesses the outlet. The most likely cause of the error is that the display label outlet is not connected to the label in the storyboard. Connecting the label in the storyboard to the outlet should fix that error. Your submitAction function also has the potential for the same error because you are force unwrapping optionals. When you add ! to a variable name, and that variable is nil, your app is going to crash. The following article has more details on dealing with the error you're getting: https://www.swiftdevjournal.com/fixing-the-thread-1-fatal-error-unexpectedly-found-nil-while-implicitly-unwrapping-an-optional-value-error/
Feb ’23
Reply to Advice on releasing an internal OSX app
It is definitely possible to avoid the sandbox in a Mac app. Perform the following steps to turn off the App Sandbox: Open the project editor by selecting the project file on the left side of the project window. Select the target from the left side of the project editor. Click the Signing & Capabilities button at the top of the project editor. Click the Trash icon on the right side of the App Sandbox section in the project editor. I don't know if you can avoid code signing. There is a Signing section above the App Sandbox section. That's where you would turn off code signing.
Topic: Code Signing SubTopic: General Tags:
Feb ’23
Reply to Prevent Save Panel in SwiftUI Mac app from saving as file type my app exports
This is a limitation in SwiftUI. I followed the following feedback: FB11876082
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’22
Reply to Adapting old C++ Code to run on MacOS
It's been 10+ years since I used SDL so I can't provide an answer to your specific question, but I can provide some help for you to accomplish your goal. File loading code from SDL articles and tutorials aren't going to work well on Mac because Mac apps have a different structure. Mac apps are app bundles that look like a single file in the Finder but have folders and files inside them. You can examine the contents of app bundles in the Finder by selecting a file, right-clicking, and choosing Show Package Contents. In a Mac game the sound and image files are in the app bundle. Windows and Linux do not have app bundles. If you use code to load a sound file, such as the following, in a Mac game: Mix_Chunk* sound = Mix_LoadWAV("sounds/rm1.wav"); The game won't be able to find and load the file. The big thing to get file loading to work properly with SDL on Mac is to create an Xcode project that creates an app bundle, not a command-line tool project. You may be able to find SDL Xcode project templates on GitHub or at the SDL site that take care of things for you. But you can also create an App project that uses Objective-C as the language and storyboards for the user interface. Delete the .m, .h, and storyboard files from the project. Add SDL and your C++ code. The following tutorial is old so the screenshots are going to look very different, but it shows how to set up SDL2 with Xcode: https://www.meandmark.com/blog/2012/01/using-sdl-with-xcode-4/ The following Reddit thread has a link to a newer article on using SDL with Xcode: https://www.reddit.com/r/Xcode/comments/zi9oku/how_do_i_set_up_sdl_with_xcode/
Replies
Boosts
Views
Activity
Dec ’22
Reply to How to set the minimum OS version for an ios project?
Open the project editor by selecting the project file from the left side of the project window. Select the app target from the target list on the left side of the project editor. Click the General button at the top of the project editor. Go to the Minimum Deployments section to set the deployment target.
Replies
Boosts
Views
Activity
Dec ’22
Reply to Portrait only app for iPad
You can set the device orientations your app supports from Xcode's project editor. Open the project editor by selecting the project file from the left side of the project window. Select the app target from the target list on the left side of the project editor. Click the General button at the top of the project editor. Go to the Deployment Info section Select the checkboxes for the iPad orientations you want to support.
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Dec ’22
Reply to Command SwiftCompile failed with a nonzero exit code
The error message says there was an error compiling your code. The actual errors should appear in the issue navigator (shown in your screenshot) or the report navigator (Press Cmd-9 to open). Your screenshot isn't showing any additional errors. If you choose Product > Clean Build Folder in Xcode and build the project, does the error go away? If not, do additional errors appear in the issue navigator? Did you make any changes in your code recently before building the project? For anyone to provide additional help, you need to provide more information on what you were doing before you got the error.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’22
Reply to unrecognized selector sent to instance
The problem is more likely to be in the storyboard than in the code you provided. What is the class name of the view controller in the storyboard's identity inspector? Choose View > Inspectors > Identity in Xcode to show the identity inspector. The class name in the storyboard needs to be the name of your view controller's class, ViewController in your code example. What is most likely happening is the view controller's class is UIViewController in the storyboard. UIViewController doesn't have a buttonPressed selector, ViewController does. If you change the name of the class to ViewController, the error should go away. Is the IBAction connected? There should be a filled-in circle next to the line of code in Xcode's editor. If the error persists, you will have to provide more information on how you set up your storyboard for anyone to help you.
Replies
Boosts
Views
Activity
Dec ’22
Reply to xcode 14.2 doesn't open my projects
You need to provide more information for anyone to help you. What happens when you open a project? Be specific and detailed. Are you able to create a new project?
Replies
Boosts
Views
Activity
Dec ’22
Reply to Aquestion About OS high sierra 10.13.6
You would not be able to submit apps to the App Store with macOS 10.13. Currently you need to use Xcode 13 to submit apps to the App Store. Xcode 13 requires macOS 11. Pretty soon this requirement will be bumped up to Xcode 14, which requires macOS 12. You listed macOS as a tag. With macOS 10.13 you could create Mac apps for people to download and install on your own site, bypassing the App Store.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to View Controller File missing in Xcode 14
The most likely cause of your problem is that you did not explicitly specify the interface when creating the project. Xcode defaults to using SwiftUI for new projects. SwiftUI does not have view controllers. You must explicitly choose Storyboard from the Interface menu when creating the project to get a view controller file. The following article has more detailed information: https://www.swiftdevjournal.com/xcode-11-missing-view-controllers/
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to Apple requires old and new apps to be built with Xcode 14.1 and iOS 16.1 SDK?
Does this mean that old apps making new app store updates would also have to build with Xcode 14.1 and the iOS 16.1 SDK after April 2023? I'm 99 percent sure the answer is Yes.
Replies
Boosts
Views
Activity
Jan ’23
Reply to How to download my current build to edit
Apple doesn't have your source code to download. You should have the code on your Mac if you developed the app. If someone developed the app for you, they have the source code. Get the code from them.
Replies
Boosts
Views
Activity
Jan ’23
Reply to MacOS SwiftUI app hangs after view creation
I've tried running instrumentation to figure out what is going on here, Do you mean you profiled the app with Instruments? If so, what templates did you use? I recommend profiling your app with Instruments. Choose Product > Profile in Xcode to profile with Instruments. The App Launch, SwiftUI, and Time Profiler Instruments templates will help you find what's taking so long. The App Launch should help if the slowness you're experiencing occurs when launching your app. You may also find the following article helpful: https://www.swiftdevjournal.com/finding-the-slow-spots-in-your-code-with-the-time-profiler-instrument/
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
You are getting an error because displayLbl is an implicitly unwrapped optional whose value is nil. You declared the type to be UILabel!. By adding the ! character you set your app to crash if the outlet is nil and your code accesses the outlet. The most likely cause of the error is that the display label outlet is not connected to the label in the storyboard. Connecting the label in the storyboard to the outlet should fix that error. Your submitAction function also has the potential for the same error because you are force unwrapping optionals. When you add ! to a variable name, and that variable is nil, your app is going to crash. The following article has more details on dealing with the error you're getting: https://www.swiftdevjournal.com/fixing-the-thread-1-fatal-error-unexpectedly-found-nil-while-implicitly-unwrapping-an-optional-value-error/
Replies
Boosts
Views
Activity
Feb ’23
Reply to Create an iOS app for a single customer
Use unlisted app distribution to limit an app to a select group of people. https://developer.apple.com/support/unlisted-app-distribution/
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to Advice on releasing an internal OSX app
It is definitely possible to avoid the sandbox in a Mac app. Perform the following steps to turn off the App Sandbox: Open the project editor by selecting the project file on the left side of the project window. Select the target from the left side of the project editor. Click the Signing & Capabilities button at the top of the project editor. Click the Trash icon on the right side of the App Sandbox section in the project editor. I don't know if you can avoid code signing. There is a Signing section above the App Sandbox section. That's where you would turn off code signing.
Topic: Code Signing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’23