Post

Replies

Boosts

Views

Activity

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 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 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 Prevent Save Panel in SwiftUI Mac app from saving as file type my app exports
This question got a response in Apple's Q & A Slack https://appledeveloper.slack.com/archives/C043025CS59/p1670878510681929 The suggestion was to limit the content types using the .fileExporter modifier. I haven't written any code to open a Save panel when saving the document. I have the default SwiftUI behavior. How would I use .fileExporter when someone chooses File > Save?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’22
Reply to Differences between "Obj-C in iOS App Development" and "Obj-C in MacOS CommandLine Development"
Objective-C takes the C language and adds support for object-oriented programming. The function example you showed for iOS is an example of an Objective-C method. A method is a function that is part of a class. Objective-C methods put the return type in parentheses, (void). Objective-C has two types of methods: instance and class. An instance method starts with - while a class method starts with +. You showed an example of an instance method. The function example you showed for Mac is an example of a C function. Objective-C supports C functions. C functions do not put the return type in parentheses. C does not have classes so it does not have methods. Apple provides the following guide to Objective-C: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Introduction/Introduction.html The following book teaches Objective-C for people who already know Swift: https://www.hackingwithswift.com/store/objective-c-for-swift-developers
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’22
Reply to upgraded to OS Monterey and Xcode 14.1, Xcode won't work because I done have an info file
The Packaging collection of build settings has the build settings for automatically generating an Info.plist file. To access the build settings, Select your project from the left side of the project window to open the project editor. Select the app target from the left side of the project editor. Click the Build Settings button at the top of the project editor. Typing Info.plist in the search field in the build settings list will show the build settings that deal with the Info.plist file.
Nov ’22
Reply to C Programming
I'm just checking if I'm doing anything wrong No one here can tell you if you're doing anything wrong because you haven't mentioned what you're doing other than doing some C programming. Some information that would let people help you would include the following: The version of Xcode you're running The version of macOS you're running The Mac model you're using, amount of RAM, and amount of storage The type of Xcode project you created The number of files in the project The specific activity that causes the beach ball: opening the project, selecting a file, editing code, building the project, etc. Do you have any large files (tens of thousands of lines of code) in the project? Are you using any external libraries?
Nov ’22
Reply to One Xcode project, different SDKs for different architectures
You don't need to use multiple SDKs. You can use the latest SDK and support older OS versions. If you want to support macOS 10.10, set the deployment target to 10.10. You have to be careful to avoid using anything Apple introduced in later OS versions. For example to using SwiftUI in a Mac app will not allow the app to run on anything earlier than 10.15. Take a look at the following articles for more details: https://www.swiftdevjournal.com/supporting-older-versions-of-ios-and-macos/ https://www.swiftdevjournal.com/using-new-api-features-in-swift-while-supporting-older-os-versions/
Oct ’22
Reply to SpriteKit - How do I learn to use this?
You can find the book 2D Apple Games by Tutorials at the following URL: https://github.com/raywenderlich/deprecated-books SpriteKit hasn't changed much since the book came out. The biggest issue you'll have to deal with is Xcode changes. The following sites has some introductory articles on using SpriteKit: https://www.checksimgames.com/
Topic: App & System Services SubTopic: Core OS Tags:
Oct ’22