Debugging iPhone web pages Bây giờ bạn đã học được làm thế nào để mã các trang web iPhone trong nhiều cách khác nhau, có lẽ bạn đang sẵn sàng để nhảy ngay in Nhưng khi chúng tôi thảo luận trong chương cuối cùng, lập trình các trang web tuyệt vời iPhone không chỉ là về cách sử dụng quyền thư viện, đó là về cách sử dụng các công cụ bên phải là tốt. Trong chương 7, chúng tôi thảo luận một công cụ cụ thể, sự phát triển Dashcode nền tảng | Debugging iPhone web pages This chapter covers Installing a local server to aid debugging Using a variety of browsers and add-ons Profiling iPhone code Now that you ve learned how to code iPhone web pages in a variety of ways you re probably ready to dive right in. But as we discussed in the last chapter programming great iPhone web pages isn tjust about using the right libraries it s about using the right tools as well. In chapter 7 we discussed a specific tool the Dashcode development platform. Now we re going to look at some more general tools that can be used to test and debug a variety of programs. We ll begin with the most fundamental tool of all the Apache web server. Using Apache locally If you have a Mac OS X computer you can take advantage of its built-in Apache web server to quickly prototype and test web pages. Setting it up is a simple process as outlined in table . 143 144 Chapter 8 Debugging iPhone web pages Table Setting up your local Macintosh to preview web pages is quick and simple. Step Description 1. Start up your web server. From the Apple menu choose System Preferences. Click the Sharing icon. Select the Web Sharing checkbox. 2. Share files. Create files with a plain text editor such as Emacs which can be accessed from the Terminal. Move the files to the Sites folder in your directory. 3. Test. Visit your web pages from your Mac at http Your Username Test test test. The benefit of developing and testing your web pages locally is that you can do so without affecting your live pages. Further since Mac OS X is essentially a Unix system you can set up your local system to mimic your web server as closely as you d like. With just a few minutes of work Shannon was able to set up his own test page which we ve used to double-check a lot of the web code in this book. This was the URL http Shannon Appelcline After you ve viewed a web page from your local machine and seen that it generally works you ll probably .