Programming iOS 6 3rd Edition Fundamentals of iPhone iPad and iPod touch Development Matt Neuburg download
Programming iOS 6 3rd Edition Fundamentals of iPhone iPad and iPod touch Development Matt Neuburg download
https://ebookultra.com/download/programming-ios-6-3rd-edition-
fundamentals-of-iphone-ipad-and-ipod-touch-development-matt-
neuburg/
https://ebookultra.com/download/the-business-of-ios-app-
development-3rd-edition-for-iphone-ipad-and-ipod-touch-taylor-pierce/
https://ebookultra.com/download/ios-4-programming-cookbook-solutions-
examples-for-iphone-ipad-and-ipod-touch-apps-1st-edition-vandad-
nahavandipoor/
Pro iOS Table Views for iPhone iPad and iPod Touch 1st
Edition Tim Duckett (Auth.)
https://ebookultra.com/download/pro-ios-table-views-for-iphone-ipad-
and-ipod-touch-1st-edition-tim-duckett-auth/
https://ebookultra.com/download/ios-9-programming-fundamentals-with-
swift-swift-xcode-and-cocoa-basics-2nd-edition-matt-neuburg/
Pro Core Data for iOS Data Access and Persistence Engine
for iPhone iPad and iPod touch 2nd Edition Michael Privat
https://ebookultra.com/download/pro-core-data-for-ios-data-access-and-
persistence-engine-for-iphone-ipad-and-ipod-touch-2nd-edition-michael-
privat/
https://ebookultra.com/download/take-control-of-mail-on-the-ipad-
iphone-and-ipod-touch-third-edition-joe-kissell/
iOS Recipes Tips and Tricks for Awesome iPhone and iPad
Apps 1st Edition Matt Drance
https://ebookultra.com/download/ios-recipes-tips-and-tricks-for-
awesome-iphone-and-ipad-apps-1st-edition-matt-drance/
https://ebookultra.com/download/programming-ios-10-dive-deep-into-
views-view-controllers-and-frameworks-7th-edition-matt-neuburg/
Programming iOS 6
Matt Neuburg
www.it-ebooks.info
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 [email protected].
Editor: Rachel Roumeliotis Cover Designer: Randy Comer
Production Editor: Kristen Borg Interior Designer: David Futato
Proofreader: O’Reilly Production Services Illustrator: Matt Neuburg
Indexer: Matt Neuburg
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]
www.it-ebooks.info
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
iii
www.it-ebooks.info
Instance References, Initialization, and nil 49
Instance References and Assignment 51
Instance References and Memory Management 52
Messages and Methods 54
Sending a Message 54
Declaring a Method 55
Nesting Method Calls 56
No Overloading 57
Parameter Lists 58
Unrecognized Selectors 59
Typecasting and the id Type 61
Messages as Data Type 65
C Functions 66
CFTypeRefs 67
Blocks 68
4. Objective-C Classes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Class and Superclass 75
Interface and Implementation 77
Header File and Implementation File 79
Class Methods 82
The Secret Life of Classes 83
5. Objective-C Instances. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
How Instances Are Created 85
Ready-Made Instances 85
Instantiation from Scratch 87
Nib-Based Instantiation 90
Polymorphism 91
The Keyword self 93
The Keyword super 97
Instance Variables and Accessors 98
Key–Value Coding 100
Properties 102
How to Write an Initializer 104
iv | Table of Contents
www.it-ebooks.info
The Navigator Pane 113
The Utilities Pane 118
The Editor 119
The Project File and Its Dependents 122
The Target 125
Build Phases 125
Build Settings 126
Configurations 128
Schemes and Destinations 129
From Project to App 131
Build Settings 133
Property List Settings 133
Nib Files and Storyboard Files 134
Other Resources 135
Code 137
Frameworks and SDKs 139
8. Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
The Documentation Window 172
Class Documentation Pages 174
Sample Code 177
Other Resources 178
Quick Help 178
Symbols 179
Header Files 180
Internet Resources 180
Table of Contents | v
www.it-ebooks.info
Localization 188
Editing Your Code 192
Autocompletion 193
Snippets 195
Fix-it and Live Syntax Checking 195
Navigating Your Code 196
Debugging 199
Caveman Debugging 199
The Xcode Debugger 202
Unit Testing 208
Static Analyzer 208
Clean 209
Running in the Simulator 210
Running on a Device 212
Profile and Device Management 215
Version Control 216
Instruments 219
Distribution 223
Ad Hoc Distribution 225
Final App Preparations 226
Icons in the App 226
Other Icons 227
Launch Images 228
Screenshots 230
Property List Settings 231
Submission to the App Store 233
vi | Table of Contents
www.it-ebooks.info
NSValue 257
NSData 257
Equality and Comparison 258
NSIndexSet 258
NSArray and NSMutableArray 259
NSSet and Friends 261
NSDictionary and NSMutableDictionary 262
NSNull 264
Immutable and Mutable 264
Property Lists 265
The Secret Life of NSObject 266
www.it-ebooks.info
Unusual Memory Management Situations 324
Nib Loading and Memory Management 329
Memory Management of Global Variables 330
Memory Management of Pointer-to-Void Context Info 331
Memory Management of CFTypeRefs 332
Properties 335
Property Memory Management Policies 336
Property Declaration Syntax 338
Property Accessor Synthesis 340
Dynamic Accessors 342
www.it-ebooks.info
CIFilter and CIImage 418
Drawing a UIView 421
Graphics Context Settings 423
Paths and Drawing 425
Clipping 429
Gradients 430
Colors and Patterns 432
Graphics Context Transforms 434
Shadows 436
Points and Pixels 437
Content Mode 438
Table of Contents | ix
www.it-ebooks.info
Keyframe Animation 497
Making a Property Animatable 498
Grouped Animations 499
Transitions 503
The Animations List 505
Animation and Autolayout 507
Actions 511
What an Action Is 511
The Action Search 511
Hooking Into the Action Search 513
Nonproperty Actions 516
Emitter Layers 517
CIFilter Transitions 523
Part V. Interface
19. View Controllers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
The View Controller Hierarchy 568
View Controller and View Creation 572
Manual View 575
Generic Automatic View 578
View in a Separate Nib 579
x | Table of Contents
www.it-ebooks.info
Nib-Instantiated View Controller 583
Storyboard-Instantiated View Controller 585
Rotation 588
Rotation and Layout Events 592
Initial Orientation 595
Presented View Controller 599
Presented View Animation 604
Presentation Styles 605
Rotation of a Presented View 608
Presenting a View in Response to Rotation 609
Tab Bar Controllers 610
Tab Bar Items 611
Configuring a Tab Bar Controller 612
Navigation Controllers 614
Bar Button Items 617
Navigation Items 619
Toolbar Items 622
Configuring a Navigation Controller 622
Page View Controller 625
Container View Controllers 630
Storyboards 633
Segues 635
Unwind Segues 637
Storyboards and Custom Container View Controllers 642
View Controller Lifetime Events 642
View Controller Memory Management 646
State Restoration 649
Participating in State Restoration 651
Restoration ID and Restoration Class 653
Restoring View Controller State 661
Table of Contents | xi
www.it-ebooks.info
Scroll View Performance 692
www.it-ebooks.info
The Text Field Menu 812
UITextView 814
Core Text 817
www.it-ebooks.info
Random documents with unrelated
content Scribd suggests to you:
years, and paid her subscription to 1855. Another, a gentleman,
remitted his subscription in full up to 1860. We fancy that there are
few other publications can give such instances as these.
A STRING OF EPITAPHS.
"WEEP, stranger, for a father spilled
From a stage-coach, and thereby killed:
His name was John Sykes, a maker of sassengers,
Slain with three other outside passengers."
God be praised!
Here is Mr. Dudley, senior,
And Jane, his wife, also,
Who, while living, was his superior;
But see what death can do.
Two of his sons also lie here,
One Walter, t'other Joe;
They all of them went in the year 1510 below.
In St. Michael's Churchyard, Aberystwith, is another, to the memory
of David Davies, blacksmith:—
PHILADELPHIA AGENCY.
"W. J. M."—Cannot send the "Lady's Book" previous to January,
1851. Wish we had the eight years to send you.
"Clara S."—Will find explanations of the abbreviations of crochet
terms in this number; also March number, page 279; and in our May
number we will give further directions.
"L. M. H."—Sent you patterns by mail on 18th.
"Miss A. R."—Sent your hair bracelet on the 18th.
"Miss P. S."—Sent your ring and thimble on the 19th.
"O. V. H."—Sent your gold pen on 19th.
"B. A. C."—Sent the cap patterns by mail on 19th.
"M. P. R." commits the common error of not dating letter nor giving
place of residence. The postmark, like every other postmark, is
illegible. One-half the letters we receive have the same omissions,
giving us a great deal of trouble. We can supply the numbers; but
how can we tell what the postage will be when we don't know their
destination? The price of the numbers will be 25 cents. The
communication was received too late for March number.
"Miss E. P."—Sent your patterns on 20th.
"Graduate" is informed that he had better advertise in the papers
here for the situation he wants. There is no other way of procuring
it. We have used the masculine in answering this, as "Graduate"
omits letting us know whether we are addressed by a male or
female. If a female, why not write the first name in full, or prefix
Mrs. or Miss?
"T. G. B."—Sent Rigolet by Adams's Express on 28th.
"C. C. D."—Sent Odd Fellows' Regalia by Adams & Co.
"Miss E. C. G."—Sent cotton on the 30th.
"J. W. K."—Sent jet cross on 30th.
"Miss C. R. L."—Sent apron pattern on the 2d.
"M. R. E. P."—Sent jacquette pattern 4th.
One of our subscribers wrote us upon the subject of cutting dresses
by our patterns. We have mislaid the letter. Will she please write
again?
"Miss T."—Sent cotton by mail. The postage will be expensive; but
cheaper than express.
"A. S. C."—Sent dress on the 7th by mail.
"Miss D. H."—Sent patterns by mail on 7th.
"Helen."—Boots to button at the side for winter wear are very
fashionable here. Bronze or blue gaiter boots $3, French kid slippers
$1 50. Never heard of such a mono-mania; make him wear girl's
clothing until he reforms.
"S. S. S."—Sent goods by mail (the cheapest way) on the 7th.
"T. S. H."—Sent Rapp's pen by mail on the 14th.
"Miss M. F."—Sent breastpin by mail on 14th.
"Mrs. J. A. C."—Wrote and sent you circular of prices of Boardman &
Gray's pianos.
"M. S. L."—Sent jewelry by mail on 18th.
"Bed Quilts."—Marseilles are almost invariably used now. Of course,
they are fashionable.
"J. S. B."—Too late for March number. Cannot furnish "Lady's Book"
from the commencement. We have only as far back as 1851.
"Mrs. A. V. Du B."—Sent patterns by mail on 18th.
No orders attended to unless the cash accompanies them.
All persons requiring answers by mail must send a post-office stamp.
"The wicked borroweth and payeth not again."
THE "Pennsylvania Trojan" says: "The present is decidedly the best
number, in point of illustrations, reading matter, paper, and
typography, ever issued, and every way worthy of the wide-spread
reputation of L. A. Godey. We cannot lend this number, to show it to
our friends, for Mrs. M. has taken charge of it, and is copying some
very pretty patterns of embroidery from it. However, she will take
pleasure in displaying its beauties to you."
Sent you a duplicate of that prospectus sheet, friend "Trojan."
GOOD.—A letter from a Ky. editor: "I have about one dozen
BORROWING subscribers, who all like your 'Book' remarkably well, I
presume, from their eagerness to get hold of it. I have lost one or
two of these, however, as they have sent on and subscribed for
themselves."
Don't lend, and we shall have the remainder of them soon.
ONE of our lady subscribers takes two copies of the "Lady's Book," so
that she can have one to lend. Hard case; but it is the only way, she
says, that she can secure a copy for her own perusal. We would
suggest to her to slip in the copy proposals for a club of six. The
price to each one would only be $1 67 for a year's subscription.
9. Mist.
10. The letter G.
11. A windmill.
12. Faith, Hope, Charity.
ENIGMAS.
13.
THE treasure that I render you
Surpasses any mine of gold;
'Tis clear my sterling value, too,
Is far too precious to be sold.
14.
15.
I'M good for nothing, save when kept,
As many a soul can tell;
And should exist conceal'd, except
'Gainst honor I rebel.
TO TAKE OUT IRONMOULD.—Wet the ironmould with water, and then lay
the linen on a hot water-plate and put on the part a little essential
salt of lemons. When it becomes dry, wet it again, and renew the
process, being particular that the plate is boiling hot. Dip the linen
into a good deal of water, and wash it as soon as the stain is
removed, to prevent any damage from the acid.
DOMESTIC RECEIPTS.
CREAM HASTY.—Take a gallon of milk from the cow, set it on the fire,
and when it begins to rise take it off the fire, skim off all the cream
and put it on a plate, then set the skillet on the fire again and repeat
the skimming till your plate is full of cream; put to it some orange
flower and sugar, and serve it.
CREAM "AU NATUREL."—Take some thin cream, mind and let it be fresh,
and put it in a bowl on ice to cool; add to it powdered sugar, and
serve it.
CURDS AND CREAM, AS IN SCOTLAND.—Put two quarts of new milk into the
dish in which it is to be served, and turn it with a teaspoonful of
rennet; when the curd has come, serve it with the cream in a
separate dish.
THE HOUSEHOLD.
IT is a long time ago since we rejoiced in the possession of a new
spelling-book, with a bright blue board cover (so liable to get the
corners chipped off), and learned from its fascinating pages that
ever-to-be-remembered lesson for the household—
APPLETONS'.
APPLETONS' is the very conspicuous gilt-lettered name of a large
brown-stone building just opened on Broadway, New York, for the
business purposes of this well-known firm. It was built originally for
a public library, but was bought last spring by the present owners,
and the lower story has since been fitted up for them. Henceforth,
"Appletons'" will be one of the lions of Broadway.
It may not be a very flattering comparison, but one at least easily
understood—what "Stewart's" is to the woman of fashion, or
"Taylor's" to the gourmand, "Appletons'" is now to the student or the
book fancier. The design and decorations are in perfect keeping with
the business, the very windows, deep set as they are, suggesting
the alcoves, with which it is lined, as in a public library. The ceiling
walls are ornamented in fresco, of quiet, yet cheerful tints; fourteen
Corinthian columns are the central support, and these have the
effect of Sienna marble. The book-cases and shelving are of plain
oak. The proportions and whole interior effect are admirable; and
here are to be found everything that is bindable or readable, from
superb London editions of the classics to the last new school-book,
in its plain cloth cover.
A good hour's lounge would scarcely give a just idea of the united
elegance and utility of the new establishment; for the curious visitor
should not neglect to glance at the wholesale ware-room, occupying
the warm, well-lighted basement, which has its own "exits and
entrances," its own salesmen, attendants, and purchasers, and gives
perhaps a more just estimate of the immense business of the firm.
There is certainly nothing approaching to it in this country or in
England.
TO CORRESPONDENTS.
WE must enforce upon our correspondents the necessity of being
explicit in forwarding their addresses; for we agree with them in
thinking it rather awkward for a young lady to be addressed as M. S.
Jones, Esq., or a married lady to find herself suddenly divorced, and
written to as Miss. But how are we to help it? How is the editor,
especially in the haste and confusion of a correspondence the
uninitiated cannot imagine or comprehend, to discover from internal
evidence whether the said M. S. Jones is a noun masculine or
feminine, or, being feminine, to decide upon her state and condition
regarding the holy bonds of matrimony? Let the letter read thus, and
all doubt and misdirection are at an end:—
"DEAR SIR: Inclosed is $10 for the following subscription to the Lady's
Book. MISS M. S. JONES, Dalton, Ohio"—
or Mrs., as the prefix may be. That agreeable young lady will not, in
this case, have her feelings hurt by being addressed as Esq., and so
supposed to belong to the Woman's Right party, at least; nor we be
obliged to waste, to us, very valuable time, in reading letters of
explanation or writing notes of apology. Not to mention the two
postage stamps saved—a consideration; since, by Poor Richard's rule
of compound interest—
"A penny saved is two pence got."
"MRS. BARNARD."—Let your children wear aprons, by all means. They
are not out of fashion; but, on the contrary, new patterns are
constantly being designed. See our fashion article for the present
month.
"A NEW MAMMA" will find several editions of "Mother Goose" in the
market. One is contained in "Harry's Ladder to Learning," published
by Evans & Brittan, one of the best juveniles we know, as there are
many excellent things inclosed in its covers. It can also be had
separate, postage and all, for less than a quarter of a dollar. A more
elaborate edition, as full of clever designs as the Christmas-pie of
little Jack Horner was supposed to be of plums, is published by John
Rund Smith, London, under the title of the "Nursery Rhymes of
England." Also imported by Evans & Brittan.
"MISS A. B. L." can safely have her white and muslin dresses for the
ensuing season made with infants' waists. If her figure is small and
light, they cannot fail to be becoming; and, for quite young ladies,
the style never is out of date.
"MRS. P. L.," of Darien, Geo., can have her books by package or mail.
We add to our list for reading aloud, "An Attic Philosopher in Paris:
being the Journal of a Happy Man," published by the Appletons. Its
tone is most genial and pure, entirely free from the French
sentimentality that borders on frivolity, and, at the same time, full of
pathetic truths. For the children, we would particularly commend
"Our Little Comfort" and "Love's Lessons," both of which are
admirable.
"MRS. H."—An infant's skirt should not be over a yard in length. Of
course, the petticoats should be a hem shorter, the flannel shortest
of all.
"MISS LIZZIE N."—See fashion article.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookultra.com