Why is it showing me an error while print, in a plain game project? - swift

I have created an empty Game Project. I tried to use "print" to start with, but got an error right away. I have no idea what could be wrong, I'm a beginner.

The print statement you write must be written in another method.

Related

Errors after deleting an action using Unity's new input system

I'm using Unity's new input system. I recently deleted some actions, and now I'm getting the following error whenever I go into Play mode. As stated here, the error doesn't break anything, but it's annoying to always see errors in my console. Is there any way to refresh the input settings so that the actions I deleted are completely removed and this error goes away?
Cannot find action 'Camera/New action1' with ID 'af026e96-883f-4172-ba96-2d8225a11f0f' in
'PlayerInput (UnityEngine.InputSystem.InputActionAsset)
UnityEngine.InputSystem.PlayerInput:OnEnable() (at Library/PackageCache/
com.unity.inputsystem#1.0.0/InputSystem/Plugins/PlayerInput/PlayerInput.cs:1564)
Its just a bug in Unity, if you just go to any game object with player input, change default map to some other value and just change it back to original and save, the error will go away.
If you go to the object in the inspector, re-select it, and then re-save it then the error should stop.

Can't run the project cause of the EXC_BAD_ACCESS

I am working on a project and I have no professional experience on iOS development. Any way after I update my Xcode 11.0 (now it's 11.1) I can't run the project in any way. But if I try to open my 1 year old project it's open without any problem. I got all the time Thread 1: EXC_BAD_ACCESS (code=2, address=0x7ffee4ac0e98) and interesting part is error itself does not show up same spot. If I delete or modify the faulty field it just pop up completely different line. I want to show code but it does not occur in a specific place.
But error generally pops up the one of my third party code. I used MyThirdPartyTextFieldAnimationFiles and here I used IsaoTextField.swift and TextFieldEffects.swift. In TextFieldEffect.swift file declaration public let placeholderLabel = UILabel() gives the error first. I don't understand where the error originated from. Thanks for helping any way.
Kind Regards.
I solve the problem but this solution won't be the right one. Error itself is so generic error type every can cause this. I explain my solution if one of you get that error he/she can use that maybe anyway.
In my app I have a NavigationController and one of my view(it is one of the views in the that NavVC) I declare the next VC at the start of the class and than push it to the top of the NavigationController. The error is cause by that declaration position. I moved it in the button function and error disappear.
Less buggy and nice days all.

Is there a way to see the order in which functions are called when we execute a program in Xcode?

Is there a way to see the order in which functions are called when we execute a program in Xcode? For instance, at runtime, if we press a button corresponding to a certain IBAction, can we see the order of method calls thereafter? I know the debugger is available, but it seems to be particularly useful when you know exactly what method calls you are looking for.
Any help would be much appreciated!
Swift flows top to bottom. This is a good post on that. As well you can run a breakpoint, also added an explanation of a breakpoint. You can use them to stop and manually advance Xcode to the next thing to execute helps a lot with debugging.
You could also do print("Function x")
in each of the functions you have. This would then print them in order of execution time.
Swift Flow
Breakpoint Article

How can I take something in then out in Eclipse?

I have been looking for a way to pull something out of my main method into a outer method then plop the output of the outer method back into the main method (this is in Eclipse).
I have been looking for a strangely long time for a answer for this but everything seems way more advanced than what I am looking for. If anyone can help it would be a great help.
You want the extract method refactoring. Select the code block that you want move into a different method and press Shift-Ctrl-M. Or is it Ctrl-Alt-M? Can't remember right now.
And here I go giving refactorings to someone that doesn't even know what a method is....

PHP4 No Error When Missing Method is Called

I have come across an annoying problem while writing some PHP4 code. I renamed the method of a class but I forgot to rename it where it was being called from. The annoying part is it was hard to track down where the problem was because no error was triggered. The script simply aborted leaving the web page partially rendered. Is it normal for this not to trigger an error or is there something wacky going on here? If this is normal is there a way to force this kind of thing to cause an error?
Try setting the error_reporting() at the top of your script, like this:
error_reporting(E_ALL); // report all errors