Say what's up everyone at soap's dot com and this is a special lesson OK.
This is a lesson that is just for you.
After thousands of students have encountered a problem and I'm going to show you how to debug it.
It's a very common thing to have happen.
It's a let's make it happen.
So if you remember from a while back one of the first lessons OK in this league or in this first welcome
be see if I right click here on the out on the document outline we've got a background image and a swoosh.
Remember how we actually made those IAB outlets.
So if I go over here into my welcome b c we've got those two ibl you remember right in your code it's
right there.
OK.
And if I run the app it should run just fine let's make sure there's no crashes or problems.
OK.
And it works just fine.
So this is the most common problem that new developers have.
And the most common thing that I answer for new developers are people who are learning and this is what
happens.
They're like OK I don't need these outlets anymore so they're like oh I don't need to call these anymore.
This is great.
And so they delete this and they go on their happy way and maybe they code for 15 more minutes and then.
OK great.
Let's go ahead and run the app.
Blah blah blah.
Run the app OK to do.
Let's look at all the code I wrote the last 15 minutes it's great.
And then it crashes.
Say it and they get this big huge error here.
Let's close the left.
I don't need that.
OK.
I just I can't open down here.
OK.
The right side open and they see all those crazy stuff and it's so confusing.
And yeah it is a little confusing.
Come on Apple really can't you just say what the problem really is.
But this is the biggest problem that people see.
OK.
Set value for undefined key and they freak out because they're brand new to programming.
They're learning all this new stuff.
In fact I'm going to save this somewhere.
Save that.
OK.
So you're going see this problem all the time.
If you did what we just did which was delete Iby out that's OK.
So the problem was what happened was you you deleted some code.
If you remember back over here in the welcome to b c we deleted some code.
OK which is great.
We don't need it anymore.
The problem is remember Interface Builder makes connections to the code.
So if we go to our main store board ok and see this welcome b c if we are right click it.
Notice how there's a yellow warning sign on these here.
OK it's like hey where's the background image and where's the swoosh.
It's supposed to be there in the code because you told me it was supposed to be there.
Well it's not there so the app crashed so all you have to do whenever you encounter this problem that
set value for undefined key.
OK and most ninety nine point nine percent of times a new developer when they see that err it's because
they did this they deleted an IP outlet and they forgot to delete the references so you go into your
interface builder you select the view controller that the problems happening on or where you deleted
the IBL lets you right click the icon and just click the x's on the warning signs.
Boom you deleted the references.
OK so the interface builder is no longer looking for those functions or outlets to be in your code.
OK.
And now it works just fine.
OK.
So this is a very special lessoned refer back to when you have this problem ok because you are going
to probably encounter it many times as you as you go and delete things.
OK.
So that's it for now.
OK.
We're going to move on before we cleaned up our Cobi did not need those I.V. outlets.
And so that's it.
Mark Price a soap's dot com doing some debugging.