Can you add some more detail to “Variables View & Return Values”? I’m not able to replicate what you’ve got on the screen. I’m close, but not quite there (do X, do Y, do Z & your screen will look like this). I’m missing a step and I know it’s important…but I don’t know what.
First, be sure the breakpoint is still fixed in the empty validation method.
Then, with the app restarted, add a new friend, and press the OK button (this could very well be the missing step). The application should stop at the breakpoint, and show the debugger with the Variables & Console View displayed since we set that up previously (Setting up the Debugger Console).
Once the Debug area appears in Xcode, you can choose the Step Out button which is located directly above the Variables View. Stepping out of a method will update the Variables View to display the Return Value for that method.
Let me know if you are still unable to replicate what is on screen. Also, I will update the tutorial soon to clarify these steps.
That’s odd, I don’t reach that endpoint at all.
When I only add the break point to the empty validation method it doesn’t do anything.
When I add the breakpoint to the if name.hasText, ... line and the empty validation method and then step in to it, i get to the name but never the isValidDateComposed(_:_:_:) method
If you see a page with hex values you might have another issue. If you want to provide a Dropbox or Google Drive link to the project, I can take a look and see what the issue is. Thanks!
If you are using R.swift it creates a directory with name R.swift. The script search in all types of files and throw an error if there’s a directory with name *.swift. To resolve this, restrict the find command to only search in files. The final script:
I’m with you up to the “Conditions for successful debugging” part and then I can’t continue. In the application (simulated) I select a “friend”, click the “add” button but I can’t put anything in the gift field. It is greyed out and if I click it, the program just unwinds to the previous screen. How can I enter “shoes” as you describe.
Regards,
“Gift Name” is a placeholder so it should be okay that you see it greyed out. But I can see what you mean with the unwind behavior.
The unwind behavior appears to happen randomly when I click outside the text fields. I wonder if the issue is related to the Stack View. It is like it causes the cancel button to dismiss the View Controller when it is not actually being clicked.
Let me try to help you further. Which device are you simulating? With an iPhone 7 I am able to access text fields and buttons okay.
@graham_stokes: Hmm, I’m not able to reproduce the issue without clicking to the left or above the “Gift Name” text field. I imagine you’ve already tried clicking into righthand side of the text fields too. I’ll keep looking into the issue to see if I can determine why it is causing the View Controller to dismiss on you.
Well please look no further. That seems to be the problem. It appears that unless the user clicks in just the right-hand half of the text box you get a “cancel” behaviour instead. My apologies for taking up your time with this, but a near lifetime of habit is not easily overcome. Anyway, if you click anywhere past the halfway mark it works. Is there any particular reason for this behaviour ? Personally I find it rather counterintuitive for a text field because - in English at least - we always write left to right so the natural place to click would be on (or to the left of) the “Gift Name” prompt.