Programming iOS 6 (3rd Edition).pdf

(20316 KB) Pobierz
1003801298.002.png
1003801298.003.png
THIRD EDITION
Programming iOS 6
Matt Neuburg
1003801298.004.png
Programming iOS 6, Third Edition
by Matt Neuburg
Copyright © 2013 Matt Neuburg. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are
also available for most titles ( http://my.safaribooksonline.com ) . For more information, contact our corporate/
institutional sales department: (800) 998-9938 or corporate@oreilly.com .
Editor: Rachel Roumeliotis
Production Editor: Kristen Borg
Proofreader: O’Reilly Production Services
Indexer: Matt Neuburg
Cover Designer: Randy Comer
Interior Designer: David Futato
Illustrator: Matt Neuburg
March 2013:
Third Edition
Revision History for the Third Edition:
2013-02-27:
First release
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly
Media, Inc. Programming iOS 6 , the image of a kingbird, and related trade dress are trademarks of O’Reilly
Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a trade‐
mark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and author assume no
responsibility for errors or omissions, or for damages resulting from the use of the information contained
herein.
ISBN: 978-1-449-36576-9
[LSI]
Table of Contents
Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Part I.
Language
1.
Just Enough C. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Compilation, Statements, and Comments 5
Variable Declaration, Initialization, and Data Types 6
Structs 9
Pointers 11
Arrays 14
Operators 15
Flow Control and Conditions 17
Functions 21
Pointer Parameters and the Address Operator 24
Files 26
The Standard Library 30
More Preprocessor Directives 30
Data Type Qualifiers 31
2.
Object-Based Programming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Objects 35
Messages and Methods 36
Classes and Instances 37
Class Methods 40
Instance Variables 41
The Object-Based Philosophy 42
3.
Objective-C Objects and Messages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
An Instance Reference Is a Pointer 47
iii
1003801298.005.png 1003801298.001.png
 
Zgłoś jeśli naruszono regulamin