文档介绍:E AN XCODER LICENSE
Copyright © 2006 by Bert Altenburg, Alex Clarke and Philippe Mougin. Version .
Attribution: The licensors, Bert Altenburg, Alex Clarke and Philippe Mougin, permit
others to copy, modify and distribute the work. In return, the licensees must give the
original authors credit.
mercial: The licensors permit others to copy, modify and distribute the work and
use the work in paid-for and free courses. In return, licensees may not sell the work itself,
although it may pany other work that is sold.
2
E AN XCODER
Contents
INTRODUCTION_____________________________________________________ 4
CHAPTER 0 - BEFORE WE START ____________________________________ 5
CHAPTER 1 - A PROGRAM IS A SERIES OF INSTRUCTIONS ____________ 6
CHAPTER 2 - MENT? EPTABLE!______________________ 11
CHAPTER 3 - FUNCTIONS ___________________________________________ 12
CHAPTER 4 - PRINTING ON SCREEN_________________________________ 17
CHAPTER 5 - COMPILING AND RUNING A PROGRAM ________________ 21
CHAPTER 6 - CONDITIONAL STATEMENTS __________________________ 28
CHAPTER 7 - REPEATING STATEMENTS FOR A WHILE_______________ 30
CHAPTER 8 - A PROGRAM WITH A GUI ______________________________ 32
CHAPTER 9 - FINDING METHODS ___________________________________ 46
CHAPTER 10 - AWAKEFROMNIB _______________________________________ 49
CHAPTER 11 - POINTERS ___________________________________________ 51
CHAPTER 12 - STRINGS _____________________________________________ 53
CHAPTER 13 - ARRAYS _____________________________________________ 58
CHAPTER 14 - MEMORY MANAGEMENT_____________________________ 61
CHAPTER 15 - SOURCES OF INFORMATION __________________________ 63
3
E AN XCODER INTRODUCTION
INTRODUCTION
Apple provides you with all the tools you need to create great Cocoa applications, for free.
This set of tools, known under the name Xcode, comes with Mac OS X, or you can
download it from the developer secti