Objective-C入门].Objective.C.for.Absolute.Beginners

所需积分/C币:9 2014-02-26 08:54:24 14.25MB PDF
收藏 收藏
举报

英文原版,适合初学者,建议学习ios编程的从英文原版开始,这样可以跟上国外的进度
Objective-C for Absolute Beginners iPhone, iPad, and Mac Programming Made Easy Gary Bennett Mitch Fisher Brad lees apress Objective-C for Absolute Beginners: iPhone, iPad, and Mac Programming Made easy Copyright o 2010 by Gary Bennett, Mitch Fisher, Brad Lees All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the ISBN-13(pbk):978-1-4.302-2832-5 ISBN-13( electronic:978-1-4302-2833-2 Printed and bound in the united states of america g87654321 Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to dietary righ President and Publisher: Paul Manning Lead Editor: Clay andres Development Editor: Douglas Pundick Technical Reviewer: James Bucanek ditorial Board: Clay Andres, Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Jonathan Gennick, Jonathan Hassell, Michelle Lowman, Matthew Moodie, duncan Parkes, Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft Matt Wade, Tom Welsh Coordinating Editor: Kelly Moritz Copy Editor: Heather Lang and Tracy Brown Compositor: MacPS, LLO Indexer: BIM Indexing Proofreading services Artist: April milne Cover Designer: Anna Ishchenko Distributed to the book trade worldwide by Springer Science+ Business Media, LLC, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax(201)348-4505, e-mail orders-ny@springer-sbm.comorvisitwww.springeronline.com Forinformationontranslationspleasee-mailrights@apress.com,orvisitwww.apress.com Apress and friends of ed books may be purchased in bulk for academic, corporate, or promotional use e Book versions and licenses are also available for most titles. For more information, reference our Special Bulk Sales-e Book licensing web page at Wwww.apRess.com/info/bulksales The information in this book is distributed on an"as is"basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work Thesourcecodeforthisbookisavailabletoreadersatwww.apress.com Contents at a Glance Contents at a glance mmmmu iv Contents ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■口■■■■■■■■■■■口■■■■■■■口■ ■■■■■■ About the authors ■■■■■■■■■■■■■■■■■■■ X About the technical reviewer Acknowledgments tmmananteanaaeanantmaaean xii Introduction…Xi Chapter 1: Becoming a Great iPhone/iPad or Mac Programmer. amamI mImI 1 Chapter 2: Programming Basics n. ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Chapter 3: It's All About the data maaaan ■■■■■■■■■■■■■国■■■■■■■■ 37 Chapter 4: Making Decisions About .. and Planning Program Flow. 57 Chapter 5: Object oriented Programming with Objective-C mmm mmn 81 Chapter 6: Introducing Objective-C and Xcode. ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Chapter 7: Objective-C Classes, objects, and Methods ■■■■■■■■■■■■■■■■■■■■■■■■口■■■■■ 117 Chapter 8: Programming Basics in Objective-C ■■■■■■■■■■■■■■■■■■■■■■■■园■■■■■■■■■■ n137 Chapter 9: comparing Data mautaauasasIaunIanIBaInaIInImIBnIBIn 157 Chapter 10: Creating User Interfaces with Interface Builder ,aain ■■■■■■■■■■■■■■■■■国■ 175 Chapter 11: Memory, Addresses, and Pointers.amamamimmmatanmnai 199 Chapter 12: Debugging Programs with Xcode ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 219 Chapter 13: Storing Information B AR m BEBEBRRIBREIREARBE IBEIRERIB REBRBEIRIR an. 237 Chapter14: Protocols and Delegates…… 提看摄 257 Index 263 Contents Contents at a glance ■■■■■■■■■口■■■■■■■■■■■口■■■■■■国■ Contents ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■口■■■■■■■■■■■口■■■■■■■口■ ■■■■■■ About the authors m x About the technical reviewer ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Acknowledgments ta,,m,,算,,,算算票Xi Introduction ■■■■■■■■■■■■■■■■口■ Chapter 1: Becoming a Great iPhone/iPad or Mac Programmer ■■■■口a■■通■■■■圆 Thinking Like a Developer……… Completing the Development Cycle...............4 Introducing Object oriented Programming Working with the Alice Interface 1盖 Summary Exercises Chapter 2: Programming Basics ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Taking a Tour with Alice…… Navigation Menu......... World window Classes, objects, and Instances in Alice object Tree... 3—45788 Editor area…, Details Area 道盖1道Ba道111 Events area Creating an Alice App--To the Moon Alice Your First objective-C Program Installing xcode 067 Launching and Using Xcode Summary... 35 Exercises CONTENTS Chapter 3: It,'s All About the Data ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■口■■■■■■■■■■■■■■國■■■■■■■■■■■■■■■■■■■ Numbering Systems Used in Programming……… Bits Byt Hexadecimal 41 Unicode… Data types Using Variable and Data Types with Alice. Data Types and objective-C.. Identifying probl Summary EXercises Chapter 4: Making Decisions About m and Planning Program Flow. Boolean logic Truth tables… Comparison Operators............ 6 Designing Apps Pseudo-code Design requirement Flowcharting Designing and Flowcharting an EXample App The App' s Design………… 1 69 Using Loops to Repeat Program Statements...................70 Coding the Example app in alice……… ding the EXample App in Objecti Nested if statements and else-If Statements 77 Improving the code Through Refactoring ..... a1国1道道 77 Moving Forward Without alice 1道1:道1道 Summary… Exercises 80 Chapter5: Object Oriented Programming with Objective-C…,,……,81 The object.....,,… What is a class… Planning Classes.... Inheritance 93 Why Use00P?...,…………94 Eliminate redundant code Ease of Debugging... Ease of Replacement............ Advanced Topics Interface Polymorphism.... Summary….., 99999999 Exercises ,道1里,正1:1:国1 Chapter 6: Introducing Objective-C and xcode.mRBRBRBRERBRERBR RBBRBEEBE EAaE A Brief History of objective-C. Understanding c language basics 98 CONTENTS Putting the" Introducing xcode Starting Up xcode 106 Creating Your First Project....a........ 10 Adding a New class.… 08 Building and running the new program .114 Summary…,, 115 Exercises …116 Chapter 7: Objective-C Classes, Objects, and Methods ■■■■■■■■■■■■■■■■■■■■口■■■■■■■ 117 Creating an Objective-C Class.am.m.a.an Declaring Interfaces and Instance Variables 119 Sending Messages(Methods) 119 Working with the Implementation File.... .. Implementing Methods Using our New class Overriding default Behavior……… Taking class methods to the Next Level................ 道1日日国111 Accessing the Xcode documentation 133 Summary Chapter&: Programming Basics in Objective-G………….,…,….……137 Creating a Simple Command Line tool 1 138 Introducing Instance Variables 准主主 140 g Instance variabl Using Getter and setter Methods 142 Introducing Properties... 144 Using properties Understanding the Importance of Conventions. 1道1:道1道 .146 Creating the My Bookstore Program…… Using the NSMutableDictionary Class Making Our object Do Something …149 Implementing Behavior 主 Cleaning Up Our Objects… 153 Using the Bookstore and Book objects...... 1,11着1面1面1 Summary… 11 Exercises 156 Chapter 9: Comparing Data aIBBIRRIRIB nmamaaaaIm. 157 Introducing Boolean Logic ... .157 Using Relational Operators Comparing Numbers… Using Boolean Expressions.............. Comparing Strings 164 Comparing Dates.... 166 Using the Switch Statement Grouping Variables Together NSArray........................ CONTENTS ISMutableArray...,.………171 NSDictionary NSMutableDictionary...... …172 Summary Exercises 174 Chapter 10: Creating User Interfaces with Interface Builder summam. 17 Understanding Interface Builder 176 The model-view-Controller Human Interface guidelines(HGs)…… 179 Creating an Example iPhone app with Interface Builder 4。f Using outlets 185 Implementing an Action 186 Using Interface Builder............................18 Document window Library Window 11 Inspector Window Creating the view 道1日日国111 19 Connecting the outlets and objects. Connecting Actions and objects... mplementation File…, 195 Broken connections in Interface builder …196 Summary……, 198 Exercises 198 Chapter 11: Memory, Addresses, and pointers mmmammmaimian 199 Understanding Memory... 200 Bits, Bytes, and bases.....................200 Understanding Memory Address Basics..... a1国1道道 Requesting Memory 1道1:道1道 208 Working with Automatic Variables and Pointers. Deallocating Memory... 209 Using Special Pointers................. 21 Managing Memory in objective-C 212 Using the Retain/Release Model Working with Implied Retain Messages 1,11着1面1面1 Sending the dealloc Message 215 If Things go wron 216 Summary… Exercises 道盖1道Ba道111 218 Chapter 12: Debugging Programs with Xcode ■■■■■a■■ ■■■■■■■■■■■■■■■■■a■■■■ 219 Getting Started with Debugging .220 Setting Breakpoints.......... 220 Debugging BasICS Working with the Debugger Controls Debugging a Program,…… Using the step controls Looking at the Thread Window and Call Stack 225 Debugging variables......

...展开详情
试读 127P Objective-C入门].Objective.C.for.Absolute.Beginners
立即下载 低至0.43元/次 身份认证VIP会员低至7折
    抢沙发
    一个资源只可评论一次,评论内容不能少于5个字
    关注 私信 TA的资源
    上传资源赚积分,得勋章
    最新推荐
    Objective-C入门].Objective.C.for.Absolute.Beginners 9积分/C币 立即下载
    1/127
    Objective-C入门].Objective.C.for.Absolute.Beginners第1页
    Objective-C入门].Objective.C.for.Absolute.Beginners第2页
    Objective-C入门].Objective.C.for.Absolute.Beginners第3页
    Objective-C入门].Objective.C.for.Absolute.Beginners第4页
    Objective-C入门].Objective.C.for.Absolute.Beginners第5页
    Objective-C入门].Objective.C.for.Absolute.Beginners第6页
    Objective-C入门].Objective.C.for.Absolute.Beginners第7页
    Objective-C入门].Objective.C.for.Absolute.Beginners第8页
    Objective-C入门].Objective.C.for.Absolute.Beginners第9页
    Objective-C入门].Objective.C.for.Absolute.Beginners第10页
    Objective-C入门].Objective.C.for.Absolute.Beginners第11页
    Objective-C入门].Objective.C.for.Absolute.Beginners第12页
    Objective-C入门].Objective.C.for.Absolute.Beginners第13页
    Objective-C入门].Objective.C.for.Absolute.Beginners第14页
    Objective-C入门].Objective.C.for.Absolute.Beginners第15页
    Objective-C入门].Objective.C.for.Absolute.Beginners第16页
    Objective-C入门].Objective.C.for.Absolute.Beginners第17页
    Objective-C入门].Objective.C.for.Absolute.Beginners第18页
    Objective-C入门].Objective.C.for.Absolute.Beginners第19页
    Objective-C入门].Objective.C.for.Absolute.Beginners第20页

    试读已结束,剩余107页未读...

    9积分/C币 立即下载 >