Trying the iOS Simulator
To make sure your Xcode installation and sample code are working properly, you should try running the sample in the iOS Simulator. The first step is to direct Xcode to build the app for the simulator rather than for a device. You don’t have the necessary certificate to load this app onto an actual device, so the simulator will do for now.
Near the upper-left corner, click the Overview drop-down menu. Choose Simulator, as shown in Figure 2-12, if it is not already chosen. Then, choose TheElements - iPhone Simulator 4.2 from the Active Executable group.
Figure 2-12. Instruct Xcode to build for the simulator running iOS 4.2
Next, click the Build and Run button in the center of the top toolbar
You will see the stages of the build process displayed in the lower-left corner of the Xcode project window. After a few moments, the iOS Simulator will launch (it’s a separate application from Xcode), and the TheElements app will automatically launch, as shown in Figure 2-13.
Figure 2-13. TheElements app running in iOS Simulator
Use the mouse as your finger to scroll through the list and click on buttons. Although there aren’t any images to zoom in this app, if you want to use a two-finger pinch or stretch gesture, hold down the Option key while clicking and dragging inside the ...
Get Learning the iOS 4 SDK for JavaScript Programmers now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.