1
00:00:05,480 --> 00:00:11,660
Say what's up everyone at soap's dot com and this is a special lesson OK.

2
00:00:11,910 --> 00:00:14,370
This is a lesson that is just for you.

3
00:00:14,370 --> 00:00:19,040
After thousands of students have encountered a problem and I'm going to show you how to debug it.

4
00:00:19,050 --> 00:00:21,600
It's a very common thing to have happen.

5
00:00:21,650 --> 00:00:23,200
It's a let's make it happen.

6
00:00:23,220 --> 00:00:30,780
So if you remember from a while back one of the first lessons OK in this league or in this first welcome

7
00:00:30,780 --> 00:00:36,600
be see if I right click here on the out on the document outline we've got a background image and a swoosh.

8
00:00:36,600 --> 00:00:39,140
Remember how we actually made those IAB outlets.

9
00:00:39,150 --> 00:00:44,610
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

10
00:00:44,610 --> 00:00:45,300
right there.

11
00:00:45,450 --> 00:00:45,740
OK.

12
00:00:45,750 --> 00:00:50,330
And if I run the app it should run just fine let's make sure there's no crashes or problems.

13
00:00:50,340 --> 00:00:51,080
OK.

14
00:00:53,410 --> 00:00:54,260
And it works just fine.

15
00:00:54,310 --> 00:00:59,200
So this is the most common problem that new developers have.

16
00:00:59,200 --> 00:01:04,180
And the most common thing that I answer for new developers are people who are learning and this is what

17
00:01:04,180 --> 00:01:04,690
happens.

18
00:01:04,690 --> 00:01:09,790
They're like OK I don't need these outlets anymore so they're like oh I don't need to call these anymore.

19
00:01:09,790 --> 00:01:10,540
This is great.

20
00:01:10,810 --> 00:01:15,550
And so they delete this and they go on their happy way and maybe they code for 15 more minutes and then.

21
00:01:15,580 --> 00:01:16,720
OK great.

22
00:01:17,050 --> 00:01:18,340
Let's go ahead and run the app.

23
00:01:18,340 --> 00:01:19,470
Blah blah blah.

24
00:01:19,660 --> 00:01:23,200
Run the app OK to do.

25
00:01:23,770 --> 00:01:26,880
Let's look at all the code I wrote the last 15 minutes it's great.

26
00:01:26,960 --> 00:01:29,440
And then it crashes.

27
00:01:29,530 --> 00:01:34,230
Say it and they get this big huge error here.

28
00:01:34,250 --> 00:01:35,380
Let's close the left.

29
00:01:35,400 --> 00:01:36,260
I don't need that.

30
00:01:36,430 --> 00:01:36,630
OK.

31
00:01:36,640 --> 00:01:38,200
I just I can't open down here.

32
00:01:38,200 --> 00:01:38,770
OK.

33
00:01:38,880 --> 00:01:42,640
The right side open and they see all those crazy stuff and it's so confusing.

34
00:01:42,640 --> 00:01:44,020
And yeah it is a little confusing.

35
00:01:44,020 --> 00:01:47,280
Come on Apple really can't you just say what the problem really is.

36
00:01:47,290 --> 00:01:52,510
But this is the biggest problem that people see.

37
00:01:52,810 --> 00:01:53,210
OK.

38
00:01:53,300 --> 00:01:57,740
Set value for undefined key and they freak out because they're brand new to programming.

39
00:01:57,740 --> 00:01:59,140
They're learning all this new stuff.

40
00:01:59,140 --> 00:02:01,440
In fact I'm going to save this somewhere.

41
00:02:04,190 --> 00:02:04,810
Save that.

42
00:02:04,940 --> 00:02:05,330
OK.

43
00:02:05,450 --> 00:02:07,610
So you're going see this problem all the time.

44
00:02:07,610 --> 00:02:10,200
If you did what we just did which was delete Iby out that's OK.

45
00:02:10,310 --> 00:02:13,590
So the problem was what happened was you you deleted some code.

46
00:02:13,760 --> 00:02:17,250
If you remember back over here in the welcome to b c we deleted some code.

47
00:02:17,390 --> 00:02:18,040
OK which is great.

48
00:02:18,040 --> 00:02:19,280
We don't need it anymore.

49
00:02:19,280 --> 00:02:23,830
The problem is remember Interface Builder makes connections to the code.

50
00:02:23,830 --> 00:02:30,250
So if we go to our main store board ok and see this welcome b c if we are right click it.

51
00:02:30,350 --> 00:02:32,630
Notice how there's a yellow warning sign on these here.

52
00:02:32,710 --> 00:02:36,260
OK it's like hey where's the background image and where's the swoosh.

53
00:02:36,350 --> 00:02:39,770
It's supposed to be there in the code because you told me it was supposed to be there.

54
00:02:40,220 --> 00:02:44,780
Well it's not there so the app crashed so all you have to do whenever you encounter this problem that

55
00:02:44,780 --> 00:02:46,590
set value for undefined key.

56
00:02:46,670 --> 00:02:50,900
OK and most ninety nine point nine percent of times a new developer when they see that err it's because

57
00:02:50,900 --> 00:02:56,690
they did this they deleted an IP outlet and they forgot to delete the references so you go into your

58
00:02:57,260 --> 00:03:01,150
interface builder you select the view controller that the problems happening on or where you deleted

59
00:03:01,250 --> 00:03:07,300
the IBL lets you right click the icon and just click the x's on the warning signs.

60
00:03:07,380 --> 00:03:09,020
Boom you deleted the references.

61
00:03:09,120 --> 00:03:15,520
OK so the interface builder is no longer looking for those functions or outlets to be in your code.

62
00:03:15,680 --> 00:03:16,490
OK.

63
00:03:16,490 --> 00:03:18,430
And now it works just fine.

64
00:03:18,530 --> 00:03:19,070
OK.

65
00:03:19,280 --> 00:03:24,080
So this is a very special lessoned refer back to when you have this problem ok because you are going

66
00:03:24,080 --> 00:03:27,230
to probably encounter it many times as you as you go and delete things.

67
00:03:27,230 --> 00:03:27,670
OK.

68
00:03:27,980 --> 00:03:29,110
So that's it for now.

69
00:03:29,390 --> 00:03:29,780
OK.

70
00:03:29,870 --> 00:03:33,010
We're going to move on before we cleaned up our Cobi did not need those I.V. outlets.

71
00:03:33,050 --> 00:03:34,070
And so that's it.

72
00:03:34,070 --> 00:03:38,920
Mark Price a soap's dot com doing some debugging.
