Assignment2B-Walkthrough iPhone开发教程讲义.pdf
文本预览下载声明
CS193P Assignment 2B Walkthrough
Winter 2010 Cannistraro/Shaffer
CS193P: HelloPoly Walkthrough
Overview
The goal of this ‘walkthrough’ is to give you a fairly step by step path through building a simple Cocoa Touch
application. You are encouraged to follow the walkthrough, as it should help you successfully complete the
assignment, help you quickly become familiar with the tools and basic iPhone development workflow.
Also keep in mind, that although you will be navigating a series of steps in tools, what you are building is the
connected group of objects diagrammed below. You will define a controller object with instance variables
(outlets) that refer to the user interface elements.
The controller object implements behavior, action methods, that adjusts the number of sides of a polygon.
You will connect each control so that the target of the control is the controller, and the action that will be
sent is one of ‘increase’ or ‘decrease’.
Create a new Cocoa Touch project:
1. Select menu File New Project…
2. Select iPhone OS Application, then choose the Window-Based Application template
3. Name the project ‘HelloPoly’
Page 1 of 14
CS193P Assignment 2B Walkthrough
Winter 2010 Cannistraro/Shaffer
Setting the Active SDK
For simplicity, we’ll use the iPhone Simulator in this walkthrough. When building iPhone applications you
need to tell Xcode which platform to build against. To change the Active SDK use the Project Set Active
SDK menu item. Set this to ‘Simulator - iPhone OS 2.0’. There is also a handy toolbar popup labe
显示全部