Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

4. Multiple Views: A table with a view > The Xcode debugger shows you the state...

The Xcode debugger shows you the state of your application

The debugger shows your code and also adds a stack view and a window to inspect variables and memory. When you click on a stack frame, Xcode will show you the line of code associated with that frame and set up the corresponding local variables. There isn’t anything in the debugger window you couldn’t do with the console, but this provides a nice GUI on top of it.

image with no caption

Test Drive

Since we know that we’re having a problem near the array, try setting a breakpoint on the line that creates the array. Then build and run the app again and see what happens.

Test Drive

When you step over the breakpoint at the point where you load the array, everything is OK:

image with no caption

But hit continue and...

image with no caption

What the heck is going on?

Our application is crashing, and it’s not at the array loading code, so get back into Xcode. It will show you the line that’s causing the problem, can you see what’s wrong?

To be continued...

MultipleViews cross

Take what you’ve learned about the Navigation Controller and multiple views to fill in the blanks.

image with no caption

Across

Down

3.

The set of views that the nav controller deals with.

1.

A more versatile way to manage data beyond an array.

6.

Dictionaries use __________ to organize data.

2.

DrinkMixer is this type of app.

8.

The screen that gives you output from the app.

4.

To use a new class you need to ___________ it.

9.

A template that combines a table view and nav controls.

5.

The @ symbol is shorthand for creating one of these.

10.

Has cells that need to be customized to work.

7.

A tool in Xcode to help fix broken code.