Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com�s entire library of video tutorials.
If I want to find a function in the template, I can just search for it and so I type in, goForward and I can see the references to it anywhere in the template. Now, remember that with the web templates, what you get is the major files that you are using, main.js is something that you are usually working with. There will also be some files specific to the template so that, for example, there's a file here called browser.js which has, in fact, the functions, the code that supports the browser object and there's also a header object here, so I can look for the references in any of these to what I've searched for, goForward. Now, in Main, watch the center portion here. As I look at the 2 references to goForward, I can see that I'm finding exactly the references I was looking at before I did the search, which is usually the case because whatever you're looking at is going to show up in the search so that's not going to give me anymore clues. Now, I'll come down here to Browser which is the file that is added to the template containing support for the browser and I see we're inside a comment here. So, let me scroll up to the top of this just to make certain that I know where we are. This is in the DC Dashcode browser section and this is disclaimer and the license text and here I see Public Properties which means I can call them and use them. If I scroll down here, there are also Public Methods and here is an important note that applies not just to the browser but to everything in Dashcode. Properties and Methods beginning with an underscore are private and they may change in future Dashcode releases. What that means is that you can call them but since they may change in future releases, don't modify them because if you update to a later release of Dashcode, then the code that you've modified may not be valid anymore because there has been a change to it. So, anything that starts with an underscore, you should really not be worrying about here. You should only use Public Properties and Methods. So, if I looked down here at the other lines, I can see this is actually the declaration of the function, but inside it, I shouldn't be worried about that. Down here, I'm calling something that starts with an underscore so I just ignore that. Underscore, underscore, so this is the only line, really, the Public Method, the reference to goForward is what I should be worrying about and it tells me that it takes me to a specific view with a title, here's the documentation and what happens when the user is using the Back button. That's all I need to know to call it and don't need to modify it. So, that's what's happening with goForward. Let me go back and see what the implication was here in the Item Clicked function. In a template, it calls goForward and it says which view we want to go to and right away, you can see that there's an issue here. I don't need the list over there, let me clear the search. There's an issue right here which is that hard coded in the Item Clicked function is the fact that it is going to goForward to the Detail Level View here. So, I'm on the List Level View, you click something, the Item Clicked handler is invoked and it will automatically go to the Detail Level View. If you're going to build a multilevel browser, right here you have an issue. You need the ability to go to alternate detail views because where you may be is not necessarily where you want to go to detailLevel. If, for example, you want to do a list view that has regions of the country at list level, then what you would want is if you have regions up here, you would want the people click on one and the Item Clicked handler is invoked, you would want to go to a view that is not a detail level but is another listLevel view that contains the parks within that region of the country. So, you would have 2 list views. The first would be regions of the country, the second would be parks within that region and then if you clicked on that, you would then go to the Detail Level View and this logic expands up to n levels and keeping the list, as I said, relatively short so that they fit more or less on the screen of the iPhone and then the people drill down just by touching them, it's a very fast and efficient way of working. So, what we're going to have to do is we don't have to go into goForward, all we have to do is handle Item Clicked so that we can go to alternate lists and before we do that, we've got to build the alternate lists. So, let's take a look at building the region list that will then call the parks.
| Course: | Developing iPhone Web Apps |
| Author: | Jesse Feiler |
| SKU: | 34075 |
| ISBN: | 1-935320-89-0 |
| Release Date: | 2009-12-31 |
| Duration: | 8 hrs / 103 lessons |
| Work Files: |
Yes |
| Captions: | No |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |