Beginning iOS 5 Development Exploring the iOS SDK 1st Edition Dave Mark All Chapters Instant Download
Beginning iOS 5 Development Exploring the iOS SDK 1st Edition Dave Mark All Chapters Instant Download
com
https://ebookname.com/product/beginning-ios-5-development-
exploring-the-ios-sdk-1st-edition-dave-mark/
OR CLICK BUTTON
DOWNLOAD EBOOK
https://ebookname.com/product/beginning-iphone-4-development-
exploring-the-ios-sdk-1st-edition-david-mark/
ebookname.com
https://ebookname.com/product/beginning-iphone-development-with-
swift-3-exploring-the-ios-sdk-3rd-ed-edition-maskrey/
ebookname.com
https://ebookname.com/product/beginning-iphone-3-development-
exploring-the-iphone-sdk-1st-edition-david-mark/
ebookname.com
https://ebookname.com/product/paradigms-of-combinatorial-
optimization-2nd-edition-problems-and-new-approaches-paschos/
ebookname.com
Municipal Solid Waste to Energy Conversion Processes
Economic Technical and Renewable Comparisons 1st Edition
Gary C Young
https://ebookname.com/product/municipal-solid-waste-to-energy-
conversion-processes-economic-technical-and-renewable-comparisons-1st-
edition-gary-c-young/
ebookname.com
https://ebookname.com/product/update-on-troubleshooting-the-pvc-
extrusion-process-1st-edition-subramanian/
ebookname.com
https://ebookname.com/product/frommer-s-california-2008-frommer-s-
complete-harry-basch/
ebookname.com
https://ebookname.com/product/roman-villas-in-central-italy-a-social-
and-economic-history-annalisa-marzano/
ebookname.com
https://ebookname.com/product/primary-care-geriatrics-a-case-based-
approach-5th-edition-richard-j-ham-md/
ebookname.com
Chinese Journalist 1st Edition Hugo De Burgh
https://ebookname.com/product/chinese-journalist-1st-edition-hugo-de-
burgh/
ebookname.com
Beginning iOS 5
Development
Exploring the iOS SDK
■■■
Dave Mark
Jack Nutting
Jeff LaMarche
i
Beginning iOS 5 Development: Exploring the iOS SDK
Copyright © 2011 by Dave Mark, Jack Nutting, Jeff LaMarche
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or
part of the material is concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way,
and transmission or information storage and retrieval, electronic adaptation, computer software,
or by similar or dissimilar methodology now known or hereafter developed. Exempted from this
legal reservation are brief excerpts in connection with reviews or scholarly analysis or material
supplied specifically for the purpose of being entered and executed on a computer system, for
exclusive use by the purchaser of the work. Duplication of this publication or parts thereof is
permitted only under the provisions of the Copyright Law of the Publisher's location, in its
current version, and permission for use must always be obtained from Springer. Permissions for
use may be obtained through RightsLink at the Copyright Clearance Center. Violations are liable
to prosecution under the respective Copyright Law.
ISBN-13 (pbk): 978-1-4302-3605-4
ISBN-13 (electronic): 978-1-4302-3606-1
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 proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of
publication, neither the authors nor the editors nor the publisher can accept any legal
responsibility for any errors or omissions that may be made. The publisher makes no warranty,
express or implied, with respect to the material contained herein.
President and Publisher: Paul Manning
Lead Editor: Tom Welsh
Technical Reviewer: Mark Dalrymple
Editorial Board: Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Morgan Ertel,
Jonathan Gennick, Jonathan Hassell, Robert Hutchinson, Michelle Lowman,
James Markham, Matthew Moodie, Jeff Olson, Jeffrey Pepper, Douglas Pundick, Ben
Renow-Clarke, Dominic Shakeshaft, Gwenan Spearing, Matt Wade, Tom Welsh
Coordinating Editor: Kelly Moritz
Copy Editor: Marilyn Smith
Compositor: MacPS, LLC
Indexer: BIM Indexing & Proofreading Services
Artist: SPi Global
Cover Designer: Anna Ishchenko
Distributed to the book trade worldwide by Springer Science+Business Media New York, 233
Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail
orders-ny@springer-sbm.com, or visit www.springeronline.com.
For information on translations, please e-mail rights@apress.com, or visit www.apress.com.
Apress and friends of ED books may be purchased in bulk for academic, corporate, or
promotional use. eBook versions and licenses are also available for most titles. For more
information, reference our Special Bulk Sales–eBook Licensing web page at
www.apress.com/bulk-sales.
Any source code or other supplementary materials referenced by the author in this text is
available to readers at www.apress.com. For detailed information about how to locate your book’s
source code, go to www.apress.com/source-code/.
This book is dedicated to the memory of Steve Jobs.
We continue to be inspired by his spirit and his vision.
Contents at a Glance
Contents .............................................................................................................. v
About the Authors .............................................................................................xiv
About the Technical Reviewer ...........................................................................xv
Acknowledgments ............................................................................................xvi
Preface ............................................................................................................xvii
■Chapter 1: Welcome to the Jungle .................................................................. 1
■Chapter 2: Appeasing the Tiki Gods .............................................................. 13
■Chapter 3: Handling Basic Interaction........................................................... 45
■Chapter 4: More User Interface Fun .............................................................. 69
■Chapter 5: Autorotation and Autosizing ...................................................... 113
■Chapter 6: Multiview Applications .............................................................. 133
■Chapter 7: Tab Bars and Pickers ................................................................. 163
■Chapter 8: Introduction to Table Views ....................................................... 217
■Chapter 9: Navigation Controllers and Table Views .................................... 277
■Chapter 10: Storyboards ............................................................................. 353
■Chapter 11: iPad Considerations ................................................................. 381
■Chapter 12: Application Settings and User Defaults.................................... 407
■Chapter 13: Basic Data Persistence ............................................................ 445
■Chapter 14: Hey! You! Get onto iCloud! ....................................................... 493
■Chapter 15: Grand Central Dispatch, Background Processing, and You ..... 525
■Chapter 16: Drawing with Quartz and OpenGL ............................................ 563
■Chapter 17: Taps, Touches, and Gestures ................................................... 603
■Chapter 18: Where Am I? Finding Your Way with Core Location ................. 633
■Chapter 19: Whee! Gyro and Accelerometer! .............................................. 645
■Chapter 20: The Camera and Photo Library ................................................ 673
■Chapter 21: Application Localization........................................................... 685
■Chapter 22: Where to Next?......................................................................... 705
Index ............................................................................................................... 711
iv
Contents
vi
■ CONTENTS
vii
■ CONTENTS
viii
■ CONTENTS
x
■ CONTENTS
xi
■ CONTENTS
Blogs ...................................................................................................................................................................708
Conferences ........................................................................................................................................................708
Follow the Authors ..............................................................................................................................................710
Farewell ..............................................................................................................................................................710
Index ............................................................................................................... 711
xiii
About the Authors
Dave Mark is a longtime Mac developer and author, who has written a number
of books on Mac and iOS development, including Beginning iPhone 4
Development (Apress, 2011), More iPhone 3 Development (Apress, 2010), Learn
C on the Mac (Apress, 2008), Ultimate Mac Programming (Wiley, 1995), and
The Macintosh Programming Primer series (Addison-Wesley, 1992). Dave was
one of the founders of MartianCraft, an iOS and Android development house.
Dave loves the water and spends as much time as possible on it, in it, or near it.
He lives with his wife and three children in Virginia.
Jack Nutting has been using Cocoa since the olden days, long before it was
even called Cocoa. He has used Cocoa and its predecessors to develop software
for a wide range of industries and applications, including gaming, graphic
design, online digital distribution, telecommunications, finance, publishing,
and travel. When he is not working on Mac or iOS projects, he is developing
web applications with Ruby on Rails. Jack is a passionate proponent of
Objective-C and the Cocoa frameworks. At the drop of a hat, he will speak at
length on the virtues of dynamic dispatch and runtime class manipulations to
anyone who will listen (and even to some who won’t). Jack has written several
books on iOS and Mac development, including Beginning iPhone 4
Development (Apress, 2011), Learn Cocoa on the Mac (Apress, 2010), and Beginning iPad
Development for iPhone Developers (Apress, 2010). He blogs from time to time at
www.nuthole.com.
Jeff LaMarche is a Mac and iOS developer with more than 20 years of
programming experience. Jeff has written a number of iOS and Mac
development books, including Beginning iPhone 4 Development (Apress, 2011),
More iPhone 3 Development (Apress, 2010), and Learn Cocoa on the Mac
(Apress, 2010). Jeff is a principal at MartianCraft, an iOS and Android
development house. He has written about Cocoa and Objective-C for MacTech
Magazine, as well as articles for Apple’s developer web site. Jeff also writes
about iOS development for his widely read blog at
www.iphonedevelopment.blogspot.com.
xiv
Exploring the Variety of Random
Documents with Different Content
had had to do with the death of my rabbit, and I hope you'll forgive
me for thinking it. I had no right to think so badly of you as that, and
now I'm dreadfully ashamed to remember that I did. Do forgive me,
won't you?"
"Yes, I ought to have taken your word, Tim," said Kitty distressfully. "I
know now that you wouldn't tell a story for the world. Why, what's the
matter?"
Well might she inquire, for Tim's plain, freckled countenance was
quivering with strong emotion. The next moment he disappeared
from view on the other side of the wall, leaving the brother and sister
staring at each other in blank amazement.
"He could hardly keep from crying," said Bob, "that's why he's gone. I
should never have thought he was such a moody-hearted chap as
that."
"I didn't say anything to hurt him, did I?" asked Kitty anxiously. Then,
as Bob shook his head, she proceeded, "Fancy his keeping the
secret about Fluffy all this time! If father had allowed me to tell him
that I saw him take away the covered basket, we should have found
out the truth before. I was right about that, you see. Perhaps he'll
come back in a few minutes and talk to us again."
But Tim did not return. He had rushed indoors and upstairs to his
own room; and whilst Kitty and Bob lingered in the garden, waiting
and hoping to see his red head appear over the wall he was sobbing
by his bedside and shedding the bitterest, most repentant tears that
had ever dimmed his eyes in his short life, as he recalled the words
Kitty had spoken in such a tone of conviction—"I know now that you
wouldn't tell a story for the world."
CHAPTER XII.
TIM ENTERTAINS.
"TIM, there's a letter from your father by this evening's post," said Mr.
Shuttleworth, opening his nephew's bedroom door, "and it contains
news which will interest you. Why, dear me, what's amiss?" he
inquired, as Tim rose hastily from his knees by the bedside and
turned his tear-stained face towards him.
Tim hesitated. His uncle's voice was very kind, and the near-sighted
eyes which met his were full of sympathy. A great longing possessed
Tim to confide in some one, and, obeying the impulse of the
moment, he opened his heart to his uncle, and told him how he had
killed Kitty's rabbit and subsequently denied having overturned the
hutch, how he had tried to make amends, and how Kitty's humble
request for forgiveness for her suspicion of him and her assurance
that she knew he would not tell a lie for the world had made him feel
the falsity and cowardice of his past conduct. Mr. Shuttleworth
listened without remark until his nephew had finished his confession;
then he said:
"It seems to me, Tim, there's only one course to be taken—to make
a clean breast of everything to the people next door."
"I should like them to know, but I can't tell them—I can't!" cried Tim in
great distress. "Think what a bad opinion they'll have of me, and
they've all been so kind. I never meant to kill the rabbit, Uncle John; I
didn't know what was in the box."
"It was a spiteful trick anyway, Tim, and I don't wonder you were
ashamed afterwards when your temper had cooled down; but I don't
comprehend why, instead of owning to the truth, you were led to tell
a lie."
"It was because I was afraid the Glanvilles wouldn't have anything to
do with me if they knew what I'd done, and I did so want to be
friendly with them, Uncle John."
"Oh, Uncle John, if you only would I should be so glad! I expect they
will all despise me, but I can't have Kitty asking me to forgive her,
when—Oh, I don't think I ever before told such a big lie as the one I
told her, and it's worried me ever since."
"I'm glad to hear it, my boy; it shows me you're not in the habit of
uttering falsehoods, It's a grand thing to be truthful, for it takes a deal
of courage to be that."
"I will try not to," Tim responded earnestly, much touched by his
uncle's little sermon. "It is very good of you not to be harder on me,
Uncle John. Did you not say you had heard from father?"
"Dear me, I had forgotten that. Yes, I heard from your father by to-
night's post; he is going to have his holiday from the bank next
month, and proposes to come and fetch you home. What do you
think of his plan?"
But what Mr. Shuttleworth had been thinking he did not inform his
nephew then, for he broke off in the middle of his sentence, and a
few minutes later he went downstairs.
That night, after Tim had gone to bed, Mr. Shuttleworth made his call
next door. He saw Mr. and Mrs. Glanville, and repeated Tim's
confession to them. Needless to say they were greatly surprised; but
much to Mr. Shuttleworth's relief, Mrs. Glanville seemed to
understand Tim in the matter.
"I see he has a very passionate temper," she said, "and I can quite
believe he did not know it was a rabbit's hutch he was overturning,
for I am sure he would not wilfully injure a living creature. If only he
had owned the truth and not told Kitty that lie!"
"To me that seems the worst part of the business," said Mr.
Shuttleworth gravely. "But I think the lie brought its punishment,
judging by the distress of mind I found Tim in to-night; I do not
believe he will so easily give way to temptation again. I am afraid he
has exhibited himself to you all in a very bad light in this matter, but I
assure you he is sincerely repentant, and if your little girl and boy
can find it in their hearts to forgive him and continue to be his friends,
I shall be truly glad."
"I shall explain everything to Kitty and Bob," Mrs. Glanville replied,
"and I am sure they will not be harsh in their judgment of Tim. Poor
Tim! I must have a little talk to him myself."
Mrs. Glanville kept her word, and the following morning, whilst her
children were at school, she made a point of seeing Tim and
speaking to him as gently and sympathetically as his own mother
would have done under such circumstances, pointing out to him that
the fact of his having given way to his passionate temper and having
sought revenge had brought about the death of an innocent creature,
and had thus led him into further sin. No more was to be said on the
subject, she told him, but she hoped he had learnt a lesson he would
never forget.
"And Kitty and Bob?" Tim asked falteringly. "I suppose they won't be
friends with me any longer now?"
"Oh, yes, indeed I hope they will," Mrs. Glanville replied. "You are
going to entertain them on Saturday, you know. Had you forgotten
that?"
"No," Tim answered in a low tone. "But I thought—I was afraid that
they might not care to come. What did they say, Mrs. Glanville, when
they heard it was I who overturned the hutch?" he inquired with
considerable anxiety.
"Of course they were greatly astonished, but neither of them believe
you meant to injure the rabbit; they know you are not in the least
cruel. Kitty was hurt because you had told her a falsehood and Bob
was incredulous at first—it seems he had formed a very high opinion
of your sense of honour and truth."
But Kitty and Bob were kind-hearted children, and it was not in their
natures to harbour resentment against any one for long; so that
when Tim, rather falteringly, put forward the plan for making a tent in
the back garden, they agreed to it cordially, and set to work with a
will, and by the aid of a clothes' prop for a centre pole and several
old wrappers, they managed to erect a kind of awning under which
they decided they would have their tea.
"Won't Mr. Shuttleworth have tea with us?" asked Kitty, when
Deborah arrived with the tea-things, which were placed on a small
gipsy table inside the tent. "There's only room for two chairs, but he
can have one, can't he?"
"And you must have the other, Kitty," said Tim. "For, of course, you'll
pour out the tea."
"If you wish it, I will," the little girl replied, a look of extreme
gratification settling on her face.
"Oh, Snip, you weren't invited, sir!" she cried reproachfully, kissing
him on the top of his head.
Kitty immediately explained how Snip had come by his wounds, and
went on to give Mr. Shuttleworth a graphic description of old Jacob
Dottin and his shop, finally telling him that Fluffy had come from
there.
It was not until shortly before his visitors left that Tim plucked up
sufficient courage to speak to them about the bad turn he had served
them at the commencement of his acquaintance with them, and to
beg their forgiveness, which was willingly granted.
"Because I was so afraid if I did you and Bob would never let me be
your friend, that was my reason," he rejoined. "I bitterly repented
afterwards that I hadn't told the truth."
"Well, you can be our friend still, if you like," Bob remarked, glancing
at his sister, who nodded her head assentingly. "I'm sure we'd both of
us much rather have a friend than an enemy next door."
CHAPTER XIII.
A REGULAR BRICK.
"KITTY! Kitty!" called Bob. "Oh, there you are! Keep Snip here with
you, will you, till I'm gone? Don't let him get away and follow me!"
"Well," he said, "it's possible that we may meet Richards, and that he
may ask us to his house to tea—that is, if you're not there."
"Then you'd better go your own way!" snapped Kitty, adding under
her breath, "Such selfishness!"
Kitty assented. She took Snip into the house, and shut herself into
the dining-room with him, feeling deeply aggrieved. Mr. and Mrs.
Glanville had gone away for the day, therefore it was exceedingly
unkind of Bob, she considered, to go off with Tim Shuttleworth and
leave her.
"He makes a great deal too much of Tim," she reflected. "It's all very
well to let bygones be bygones, but Bob seems to have forgotten
altogether how disgusted he was with Tim at one time, and is making
him his chief friend. I haven't such a short memory as Bob."
This was true. Bob had a happy knack of putting anything he wished
to forget away from him. But Kitty, though she had agreed never
again to mention the ill-turn Tim had done her, often allowed her
mind to dwell on it, and the consequence was that she was
considerably less genial to him than was her brother.
By-and-bye, when she judged the boys must have taken their
departure, she decided to go out with Snip. It had rained earlier in
the day, but the weather had cleared about noon, and now the sun
was shining brilliantly. It was a really perfect May afternoon.
"I'll get some wild hyacinths for mother," the little girl thought,
remembering that she had heard Mrs. Glanville remark at breakfast
that they must now be in bloom and she would like some. "And on
my way home, I'll pass by Lang's pond and pay the boys a surprise
visit. I'll see Snip doesn't interfere with them."
"There!" she cried, as she popped the last chocolate into her mouth,
and rose. "Now we'll go to Lang's pond—we've as much right there
as anyone, eh, Snip? Still, I think I'd better lead you. Bob can't
complain if I do that."
"It's Kitty," Tim informed him. "She's brought Snip with her, but she
has him on the leash."
"Well, boys, what sport?" Kitty questioned, as she joined them. "The
fish are biting well, I suppose, after the rain? Let me see what you've
caught!"
"Three dace, two roach, and an eel!" she cried. "The dace are the
smallest I ever saw. You ought to have put them back into the water
again, they aren't worth cooking. The roach are not so bad, but—"
"I daresay you think you could catch bigger ones!" Bob broke in,
sarcastically. He was disappointed that they had not had better sport,
and his sister's candid comments had vexed him.
"No, he has not turned up," Tim answered. "He did not promise to
come—only said that he might. What lovely hyacinths you have
there!"
She placed her basket on the ground, and stood watching the boys
for some while, but she soon tired of inactivity, and strolled around
the edge of the pond, still leading Snip. By-and-bye she caught sight
of some fine forget-me-nots growing close to the water, and stooped
to gather them. At that exact moment Snip spied a water-rat, and,
jerking the leash out of his mistress' hand, sprang Into the water in
pursuit of it.
"There!" cried Bob. "I knew what it would be!" He threw aside his rod
as he spoke, and glared angrily at his sister. "You must have let him
go on purpose, Kitty!" he asserted.
"I did not!" the little girl declared. "Indeed I did not! Oh, Bob, I'm so
sorry! Come here, Snip! Come here, sir!"
But Snip paid not the least attention to her. He was now swimming
around the edge of the pond, and sniffing into the rat-runs which
undermined the bank. Tim was secretly as vexed with Kitty as was
Bob, but out of pity for her he did not show his feelings, and stood
listening in silence to the hot words which were now passing
between the sister and brother.
"Well," Bob said at length, his anger beginning to cool, "of course, if
you say you didn't let him go on purpose, I believe you, and we'll
drop the subject. We'd better go home to tea now, I suppose."
"I'm sorry I came," murmured Kitty, almost tearfully. "I know you
didn't want me. Oh, oh!" she cried, her tone suddenly changing to
one of great excitement. "Look at Snip, boys! Oh! Do look! What's
the matter with him? Oh, see how he's struggling! Oh, Bob! Oh, Tim!
He'll drown—he'll drown!"
Snip had turned a rat out of its lair in the bank, and had been
swimming across the pond, which was very deep in the centre, after
it, when something had become entwined about his hind legs, and
he was now struggling in vain to get them free.
"Oh, you don't understand!" broke in Kitty, wringing her hands in her
distress. "It's the leash! It's got around his legs, and—Oh, Bob, go to
him, go to him!"
It was all very well to say "Go to him!" But Bob could not swim, and
knowing that he would be out of his depth in the water before he
could reach Snip, he naturally hesitated. At that minute, evidently
realizing the peril of his situation, the little dog uttered a piteous cry,
which nearly drove his mistress frantic; she would have dashed into
the pond herself if her brother had not prevented her.
"Oh, what can we do?" she wailed. "Oh, this is awful—awful! Oh,
Bob, can't you do anything? Oh, Tim!—where's Tim?"
"Here!" answered Tim, behind her. "It'll be all right, Kitty! Don't you be
frightened! I'll get him!"
Kitty now perceived that Tim had divested himself of his coat and
waistcoat, and was hurriedly unlacing his boots.
"I can swim—a little," he told her. "I think I shall be able to reach him.
There!"—As he pulled off his last boot. "Now I'm ready!"
He waded into the pond till the water reached his chin, Kitty and Bob
watching him with deepest anxiety, then swam a few strokes which
brought him within reach of Snip. He grasped the little dog by the
back of the neck, and, turning, essayed to swim back with him, but
Snip continued to struggle, and no progress was made.
"Can you get off the leash?" shouted Bob. "Try! Try!"
"Yes, indeed," agreed Kitty. "But for you, Tim, poor Snip would
certainly have been drowned. Oh! I wonder what mother and father
will say when they hear about this? Oh, dear me, how dreadfully wet
you are, to be sure!"
Tim had pulled on his boots over his wet stockings with some
difficulty by this time, and was now kneeling to lace them up.
"I hope not," said Kitty, her voice full of concern, "because if you did
you might get pneumonia again. Oh, Tim, I haven't thanked you for
what you've done."
He rose from his knees as he spoke, and, meeting Kitty's eyes, still
rather tearful, smiled at her.
"Oh," the little girl cried, "you don't know how grateful I feel to you."
CHAPTER XIV.
CONCLUSION.
Kitty went into the garden, and took up her position on a seat under
the apple tree. There, in a very few minutes, Bob joined her.
"Tim has gone out with his uncle," Kitty informed him. "I saw them
start together; so I thought this would be a good opportunity to
consult you about something—Tim not being about, you know."
Kitty nodded. "He'll be going home soon now," she observed. "Dear
me, it's quite remarkable we should both of us be so friendly with him
after—"
"Not remarkable at all," her brother broke in, rather impatiently. "He's
a jolly nice fellow—he's proved it. Speak out! What is it you want to
consult me about?"
"Well, I've been thinking that before Tim leaves we ought to give him
a present," Kitty said eagerly. "You know, he really did save Snip's
life. Father says that the poor little thing would certainly have
drowned if Tim hadn't gone to him and freed him from the leash."
"I think nothing of the kind," the little girl answered, flushing. "You are
pretending to misunderstand me. I meant this—that we may never
see Tim again, and I should like to give him a present for a
keepsake, something that will put him in mind of us when he looks at
it."
"Well, I don't think that's a bad idea," Bob said, now speaking
seriously. "Let me consider. What could we give him? How much
money have you by you?"
"So you'll be good for one shilling and eight-pence. If I put a couple
of shillings to that, what could we buy? I know! A pocket-knife! We
could get a beauty, with three blades, the best that's made, for three
shillings and sixpence or four shillings."
"Oh, Bob, that would be the very thing! Tim has only an old bone-
handled pocket-knife with one blade, and that blade is broken! When
shall we get it! The new one, I mean? On Saturday?"
Thus it came to pass that the following Saturday, shortly before one
o'clock, when Tim spoke to Kitty over the garden wall, and inquired
how she and Bob were going to spend the afternoon, she replied,
with an air of reserve, which puzzled him and rather aroused his
curiosity, that they were going into the town on private business.
"But we shall not be away very long," she added. "And I daresay we
shall see you as soon as we get back."
"I don't know about that," he answered, rather piqued because the
little girl seemed afraid that he might suggest accompanying her and
her brother. "I may not be at home then."
After the mid-day meal Tim had half a mind to go for a walk in the
country by himself, for his uncle betook himself as usual to his study.
But, as Kitty had spoken of seeing him on her return from the town,
he decided to remain at home, write to his mother, and afterwards
stroll out into the garden, so that the young folks next door could hail
him if they wanted him. Accordingly, he settled himself in the dining-
room, and had barely finished his letter, when, to his great
amazement, Deborah opened the door, and announced:
"Kitty! Bob!" he exclaimed, rising from his seat at the table, and
looking quickly from one to the other of his visitors. "Why didn't you
call to me from the garden as you usually do? I should have heard
you."
"If you're writing to your people perhaps you don't want to be
disturbed, and we'd better not stay?" suggested Bob. "Hurry up,
Kitty!" he whispered to his sister.
"Oh, do stay!" cried Tim. "Sit down, won't you? Here, Kitty, have this
easy chair?"
Kitty sank into the chair indicated, but not before she had put her
hand in her pocket, and drawn therefrom a small package. It had
fallen to her lot to present the pocket-knife.
"I daresay you thought it was rather odd of me not to tell you where
Bob and I were going this afternoon," she commenced, addressing
Tim. "Now, didn't you?"
"Well, yes, I did," he admitted, candidly. "Of course, I saw you didn't
want me to go with you—"
"That was just it," Kitty broke in. "We didn't want you to go with us
because we were thinking of buying you a present. We've bought it!
Bob chose it! It's a pocket-knife, and, oh, I do hope you'll like it!
There was one with a tortoiseshell handle I rather fancied, but Bob
said he was sure you'd prefer this one—if not, the man in the shop
won't mind changing it. This one has three blades, all of the very
best steel, they cut like lances, and it has a buck-horn handle. Oh,
look at it, do!" She thrust the little package into Tim's hands as she
spoke.
Tim, who had become quite red in his surprise, opened the package
with fingers which trembled with eagerness, and a very handsome
pocket-knife was revealed to view.
"You have bought this for me?" he cried, glancing first at Kitty, who
was watching him anxiously, trying to read from the expression of his
countenance if he approved of her brother's choice, and then at Bob,
who nodded assent. "Oh, how kind—how very, very kind of you both!
Oh, thank you—thank you! Oh, it's a grand knife! Three blades! Oh, I
say, I shall never be able to thank you half enough for this!" His eyes
were sparkling with delight.
"You couldn't have given me one I should have liked better than
this," Tim said earnestly, "I'm quite sure of that."
"Oh, thank you, I should like to—you know that," Tim replied. "Just
wait whilst I put away my writing things and tell uncle where I'm
going. I say, whatever made you think of giving me a present?"
"It was Kitty who thought of it," said Bob. "And when she mentioned
it to me, I considered it a very good idea and wondered I hadn't
thought of it myself. We're awfully pleased you like the knife—it's a
keepsake, you know—something for you to remember us by."
"We shall be very sorry when you're gone," said Kitty, looking at him
with friendly blue eyes. "We shall miss you, oh, ever so much! You'll
think of us all, and of Snip—oh, I shall never forget that you saved
Snip's life! But, come, I'm sure it's near tea-time. I'm getting so
hungry!"
The three young people were very happy and merry together during
the hour or so which followed. After tea they repaired to the garden,
and on the trunk of the big apple tree Tim carved Kitty's initials, and
then Bob's, and then his own, with the big blade of his new treasure.
"Ah," said Tim, "I've a good tool—I never before handled such a
splendid knife." He shut it with a snap, and returned it to his pocket.
"Glad it suits you, old fellow!" said Bob, whilst Kitty looked very
gratified. "Yes, the initials look all right—they're very well done
indeed."
*****
Shortly before midsummer, Tim's father arrived at B—, and, after his
fortnight's holiday, returned to Dublin, taking his son with him. Tim
had been quite low-spirited at parting with his friends next door
although he had been going home; he had been sorry to say good-
bye to his uncle, too. But, as it happened, he was not to be absent
from B— long; for his uncle had offered to take him to live with him
and to send him to the B— Grammar School. And as he was to go to
his own people for the Christmas and the summer holidays, he was
simply delighted with this arrangement. So the end of September
found him once more a resident beneath his uncle's roof; and at the
beginning of the autumn term he was entered as a pupil at B—
Grammar School, where he was introduced to the boys by Bob
Glanville as "my friend, Shuttleworth."
Kitty and Bob scarcely ever think of the old days now when they
were so prejudiced against Tim Shuttleworth, and there is no one for
whom Kitty has a greater liking and regard than the boy whom she
once looked upon as her enemy.
THE END.