Post

Replies

Boosts

Views

Activity

Reply to XCODE not starting up
When you say "I never see the window", do you mean you do not see the Welcome to Xcode window? If this is the case, Xcode has launched. There happen to be no windows open. You can open the Welcome to Xcode window by choosing Window > Welcome to Xcode or pressing Cmd-Shift-1.
Jun ’21
Reply to C++ ifstream: Can't open text file
The file you are trying to open, AMatrix.txt, is not in the current working directory so the file isn't found. There are multiple ways to fix this. First, you can supply the complete path to the file in your code. Second, you can set the working directory for the Xcode scheme and set it to the directory where the file you want to open resides. In the project window toolbar to the right of the Run and Stop buttons is a path control. The left item in the path control is the name of your project. Click the item and choose Edit Scheme to open the scheme editor. Select the Run step from the left side of the scheme editor. Click the Options button at the top of the scheme editor. Select the Use custom working directory checkbox. Click the folder icon to open an Open panel to choose the working directory.
May ’21
Reply to I cannot integrate gamecenter with my spritekit
You can present a Game Center view controller without a storyboard. Your SpriteKit scene has a root view controller. let sceneViewController = self.view?.window?.rootViewController Create an instance of GKGameCenterViewController. let viewController = GKGameCenterViewController() Configure the Game Center view controller. Present the Game Center view controller from the scene view controller. sceneViewController?.present(viewController, animated: false, completion: nil) Choose Help Developer Documentation in Xcode to read the Game Center documentation, which is in the Graphics and Games section. There's an article on displaying the Game Center Dashboard and a class reference for GKGameCenterViewController. Ray Wenderlich made their 2D game development book freely available on GitHub. The book has two chapters on using Game Center. github.com/raywenderlich/deprecated-books
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to 1 duplicate symbol for architecture x86_64 Xcode
Are you adding a new file to the project and adding that code? If so, you have two main functions, giving you a Duplicate Symbol error. A C program can't have two main functions. Remove the main function in the main.c file that was created when you created the project. When you create a command-line tool project, Xcode provides a main.c file. Why are you creating another file instead of using the main function Xcode created for you.
Apr ’21
Reply to 1 duplicate symbol for architecture x86_64 Xcode
The .h file is a header file. Most C files have an accompanying header file. If you create a command-line tool project and run it without adding any files, do you get the Duplicate Symbol error message? Show the code in the new C files you're creating. When I create a command-line C project, add a C file with a header, and run the project, the project builds and prints Hello, world to the console.
Apr ’21
Reply to Deployment iOS target of app older than iOS currently running on iPhone?
The deployment target is the earliest version of iOS that can run your app. If you set the deployment target to iOS 13.2, it will run on iOS 13.2 and above, including iOS 14. The problem you're going to run into using Xcode 11.3 on a device with newer iOS versions (newer than iOS 13.2 for Xcode 11.3) is you won't be able to debug on the device. But this limitation hasn't stopped you with your device running iOS 13.5 so things wouldn't change updating to iOS 14.
Apr ’21
Reply to 1 duplicate symbol for architecture x86_64 Xcode
For anyone to help you, you need to provide more information. List the steps you take to create the Xcode project. What kind of Xcode project did you make? If you create a command-line tool project and run it, do you get the Duplicate Symbol error message? List anything else you do before building the project, such as any files you added to the project. A common cause of a Duplicate Symbol error message in a C project is to create a command-line tool project, add a new file, and add a main function to the new file. The project comes with its own main function so you end up with two main functions. A C program can have only one main function.
Apr ’21
Reply to Custom fonts in Xcode Playgrounds
Creating a theme is how you set a font for the text in Xcode. I'm not sure if Xcode supports custom fonts, but take the following steps to create a theme and set a font: Choose Xcode Preferences. Click the Themes button at the top of the preferences window. Select one of the themes that you want to duplicate. Click the Add button below the list of themes. Choose Duplicate from the menu of theme choices. Select your duplicated theme and press the Return key to rename the theme. Select all the items for the theme, starting with Plain Text and ending with the last item, which should be Heading. Below the list of items is a selected font. Next to the font is a small button. Click that button to open the Font panel and choose the font.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’21
Reply to Save When Program Exits
Make sure the saveContext function is called by setting a breakpoint on that line of code. Does it get called in applicationWillTerminate? I made a mistake in my first reply. For an iOS app the function where you should save the context is applicationDidEnterBackground. That's the function that will be called when someone quits the app. The applicationWillTerminate function does not get called until the app is purged from memory completely, which requires the user to launch several apps after quitting your app. Can you explain what you mean by "make the object persistent"? Saving the context is how you save data in Core Data.
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’21
Reply to Save When Program Exits
To save when the app exits, go to the AppDelegate.swift file. For an iOS app there will be a function called applicationWillResignActive. In a Mac app, the function will be called applicationWillTerminate. These functions are called when quitting the app. Call the saveContext function in either applicationWillResignActive or applicationWillTerminate.
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’21