【正文】
elopment. It displays framework and other help documentation, facilitates submitting your binary to the AppStore for review, anizes your various devices, and more (see figure ). It can help you keep track of your provisioning profiles as well as give you access to your crash reports on your devices (not that your apps will crash—other people need this). The Organizer can be particularly helpful in bringing up contextrelated documentation by using mandclick on text in your code. Also, it gives you access to helpful document like the “Apple Human Interface Guidelines” and “Learning ObjectiveC:A Primer.” Both are remended reading. Now that you have your bearings with Xcode and its environment, let’s build that app! A quick Hello World app As a way to explore Xcode more and get your feet wet in iOS development, you’ll create a basic app. It won’t do much, but it will be a quick pass through the basics of creating an app. First, you’ll create a new project that includes several steps to specify necessary aspects of your project. Then you’ll create the UI for your app and run it. Creating a New Project Start Xcode and, when prompted, select Create a New Project (see figure ). You’ll be presented with various options for a template for your project. Be sure that Application is selected under iOS on the top left. The appropriate options will be displayed on the right. Select Single View Application (see figure ) and click Next on the bottom right. You’ll then be prompted to name your product as well as set the pany identifier, which is typically a reverse DNS value. You’ll also specify a class prefix (for the naming convention) and specify the device family (such as iPhone). Finally, select Storyboard for UI design, reference counting for memory management, and unit tests (see figure ). Click Next and you’ll be presented with a Finder window to specify the location of the project (see figure ). You can also create a local git repository for your project during this step (see the bottom of figure ). Click Create and your project is now ready to develop! Xcode will display your default Target’s summary (see figure ). You’ll be able to see the selections you made. Pay particular attention to the naming convention using the prefix in the Navigator. Note also the Main Storyboard setting of MainStoryboard because you chose to use the Storyboard setting during your app creation. If you hadn’t checked that box, this setting would be empty and you’d have a Main Interface setting instead. The default Main Interface settings would relate to a UI design file with the file extension of xib. Instead, you have a .storyboard file in your project. Most of the projects in this book use XIB files for UI design, but you’ll use Storyboard here. Now let’s look at the file and the UI of your first app. Editing the user interface Before you change your project based on the template, let’s run it. Yep, it’s already in a state where you can pile and run it. Make sure the iPhone Simulator is selected in the scheme pulldown menu on the top left (see figure ) and click Run. Xcode will pile, link, and execute the code using the iOS Simulator. It will only display a blank white screen because your app doesn’t do anything yet. Let’s change that! Click on the Storyboard file in your project (for example