views:

241

answers:

1

Is a view controller added to the stack of view controllers at the #import line of the root view controller? Is this where indexPath gets the info about the view controllers?

I've read documentation and seen tutorials, but this aspect still isn't clear to me. I'm been learning Xcode/Obj-C for 4 months now.

Thanks, Steve

A: 

Assuming you are using a UINavigationController, it is added to the stack when you call pushViewController:.

The #import statement is pure syntax, and helps the compiler find the definitions it needs to properly compile your code.

pgb
Then my question was not worded correctly. (I used "stack" incorrectly.) How does the nav controller access the view controllers? I can make several view controllers, but I don't know how they get added to the nav controller's list of views to pop on and off.
Steve