Core Data by Tutorials iOS 8 and Swift Edition Aaron Douglas pdf download
Core Data by Tutorials iOS 8 and Swift Edition Aaron Douglas pdf download
https://ebookfinal.com/download/core-data-by-tutorials-ios-8-and-
swift-edition-aaron-douglas/
Core Data in Swift Data Storage and Management for iOS and
OS X Marcus S. Zarra
https://ebookfinal.com/download/core-data-in-swift-data-storage-and-
management-for-ios-and-os-x-marcus-s-zarra/
https://ebookfinal.com/download/ios-8-swift-programming-cookbook-
solutions-examples-for-ios-apps-1st-edition-nahavandipoor/
https://ebookfinal.com/download/ios-5-by-tutorials-
volumes-1-and-2-2nd-edition-ray-wenderlich/
https://ebookfinal.com/download/core-data-data-storage-and-management-
for-ios-os-x-and-icloud-second-edition-marcus-s-zarra/
Introducing iOS 8 1st Edition Steve Derico
https://ebookfinal.com/download/introducing-ios-8-1st-edition-steve-
derico/
https://ebookfinal.com/download/learning-ios-ui-development-implement-
complex-ios-user-interfaces-with-ease-using-swift-1st-edition-
dareglia/
https://ebookfinal.com/download/swift-data-structure-and-
algorithms-1st-edition-azar/
https://ebookfinal.com/download/test-driven-ios-development-with-
swift-4-third-edition-dominik-hauser/
Learning Swift Building Apps for macOS iOS and Beyond 3rd
Edition Jonathon Manning
https://ebookfinal.com/download/learning-swift-building-apps-for-
macos-ios-and-beyond-3rd-edition-jonathon-manning/
Core Data by Tutorials iOS 8 and Swift Edition Aaron
Douglas Digital Instant Download
Author(s): Aaron Douglas, Saul Mora, Matthew Morey, Pietro Rea
ISBN(s): 9780989675192, 098967519X
File Details: PDF, 17.11 MB
Year: 2014
Language: english
Core Data by Tutorials
By the raywenderlich.com Tutorial Team
This book and all corresponding materials (such as source code) are provided
on an "as is" basis, without warranty of any kind, express or implied, including
but not limited to the warranties of merchantability, fitness for a particular
purpose, and noninfringement. In no event shall the authors or copyright
holders be liable for any claim, damages or other liability, whether in action of
contract, tort or otherwise, arising from, out of or in connec- tion with the
software or the use or other dealings in the software.
All trademarks and registered trademarks appearing in this book are the
property of their respective owners.
Table of Contents: Overview
Introduction .............................................................................................. 9!
Chapter 1: Your First Core Data App ............................................. 15!
Chapter 2: NSManagedObject Subclasses .................................... 33!
Chapter 3: The Core Data Stack ...................................................... 58!
Chapter 4: Intermediate Fetching .................................................... 79!
Chapter 5: NSFetchedResultsController ........................................ 111!
Chapter 6: Versioning and Migration ........................................... 134!
Chapter 7: Syncing with iCloud ...................................................... 170!
Chapter 8: Unit Testing..................................................................... 188!
Chapter 9: Measuring and Boosting Performance...................... 204!
Chapter 10: Multiple Managed Object Contexts ....................... 236!
Conclusion ............................................................................................ 256!
Table of Contents: Extended
Introduction .............................................................................................. 9!
What you need ............................................................................................. 10!
Who this book is for ..................................................................................... 10!
How to use this book..................................................................................... 11!
What’s in store ............................................................................................... 11!
Source code and forums .............................................................................. 12!
Updates........................................................................................................... 12!
License ............................................................................................................. 13!
About the authors .......................................................................................... 13!
About the editors ........................................................................................... 14!
Chapter 1: Your First Core Data App ............................................. 15!
Getting started .............................................................................................. 15!
Modeling your data ..................................................................................... 23!
Saving to Core Data .................................................................................... 26!
Fetching from Core Data ............................................................................. 30!
Where to go from here? .............................................................................. 32!
Chapter 2: NSManagedObject Subclasses .................................... 33!
Getting started .............................................................................................. 33!
Modeling your data ..................................................................................... 36!
Storing non-standard data types in Core Data ...................................... 39!
Managed object subclasses ........................................................................ 40!
Propagating a managed context .............................................................. 44!
Data validation in Core Data ..................................................................... 53!
Tying everything up ...................................................................................... 56!
Where to go from here? .............................................................................. 57!
Chapter 3: The Core Data Stack ...................................................... 58!
Getting started .............................................................................................. 58!
The managed object model ........................................................................ 60!
The persistent store ....................................................................................... 60!
The persistent store coordinator ................................................................. 61!
The managed object context ...................................................................... 61!
Creating your stack object .......................................................................... 62!
Modeling your data ..................................................................................... 66!
Adding managed object subclasses .......................................................... 70!
A walk down persistence lane .................................................................... 71!
Deleting objects from Core Data ............................................................... 76!
Where to go from here? .............................................................................. 78!
Chapter 4: Intermediate Fetching .................................................... 79!
NSFetchRequest: the star of the show ....................................................... 79!
Introducing the Bubble Tea app................................................................. 80!
Stored fetch requests.................................................................................... 82!
Fetching different result types .................................................................... 87!
Sorting fetched results ................................................................................ 103!
Asynchronous fetching ................................................................................ 105!
Batch updates: no fetching required ....................................................... 108!
Where to go from here? ............................................................................ 110!
Chapter 5: NSFetchedResultsController ........................................ 111!
Introducing the World Cup app ............................................................... 111!
It all begins with a fetch request... ........................................................... 113!
Grouping results into sections.................................................................... 119!
“Cache” the ball .......................................................................................... 123!
Monitoring changes ..................................................................................... 124!
Inserting an underdog ................................................................................ 129!
Where to go from here? ............................................................................ 133!
Chapter 6: Versioning and Migration ........................................... 134!
When to migrate ......................................................................................... 134!
The migration process................................................................................. 135!
Getting started ............................................................................................ 136!
A lightweight migration .............................................................................. 137!
A manual migration .................................................................................... 146!
A complex mapping model ....................................................................... 153!
Migrating non-sequential versions ........................................................... 159!
Where to go from here? ............................................................................ 169!
Chapter 7: Syncing with iCloud ...................................................... 170!
Getting started ............................................................................................ 171!
CloudNotes ................................................................................................... 172!
Enabling iCloud ........................................................................................... 173!
The cloud stack ............................................................................................ 175!
Testing iCloud .............................................................................................. 176!
Responding to iCloud changes.................................................................. 182!
Switching iCloud accounts .......................................................................... 184!
Where to go from here? ............................................................................ 187!
Chapter 8: Unit Testing..................................................................... 188!
Getting started ............................................................................................ 189!
Core Data stack for testing ....................................................................... 190!
Your first test ................................................................................................ 191!
Asynchronous tests ....................................................................................... 194!
Tests first ....................................................................................................... 196!
Validation and refactoring ....................................................................... 200!
Where to go from here? ............................................................................ 203!
Chapter 9: Measuring and Boosting Performance...................... 204!
Getting started ............................................................................................ 204!
Measure, change, verify ............................................................................ 207!
Fetching and performance ........................................................................ 217!
Where to go from here? ............................................................................ 235!
Chapter 10: Multiple Managed Object Contexts ....................... 236!
Getting started ............................................................................................ 236!
Doing work in the background ................................................................. 242!
Editing on a scratchpad ............................................................................. 248!
Where to go from here? ............................................................................ 254!
Conclusion ............................................................................................ 256!
Dedications
“To my partner, Mike, who supports all of the weirdness that is me.”
–Aaron Douglas
“To my Wife – without your tireless support behind the scenes, all my
work the world enjoys would not be possible.”
–Saul Mora
–Matthew Morey
–Pietro Rea
Introduction
By Greg Heo
What is Core Data? You'll hear a variety of answers to this question: It’s a
database! It's SQLite! It's not a database! And so forth.
Here's the technical answer: Core Data is an object graph management and
persistence framework in the OS X and iOS SDKs.
That means Core Data can store and retrieve data, but it is not a relational
database like MySQL or SQLite. Although it can use SQLite as the data store behind
the scenes, you don’t think about Core Data in terms of tables and rows and
primary keys.
Imagine you’re writing an app to keep track of dining habits. You have a varied set
of objects: restaurant objects, each with properties such as name and address;
categories, to organize the restaurants; and visits, to log each visit to a restaurant.
The object graph in memory might look something like this:
Object graph management means Core Data works with objects that you define,
such as the ones in the diagram above. For example, each restaurant (represented
by a red bubble) would have a property pointing back to the category object. It
would also have a property holding the list of visits.
raywenderlich.com Page 9
Core Data by Tutorials Introduction
Persistence means the data is stored somewhere durable such as the device’s
flash memory or “the cloud.” You point to the entire graph and just say “save.”
When your app launches, you just say “load” and the entire object graph pops up in
memory again, ready for use. That’s Core Data at work!
Maybe your users eat out a lot and have thousands of restaurant visits—rest
assured Core Data is smart about lazily loading objects and caching to optimize
both memory usage and speed.
Core Data has many other features aside from simply storing and fetching data:
You can perform custom filtering with predicates, sort the data and synchronize a
data store with iCloud, among other things. You’ll learn all about these features and
more in this book.
If you’re a complete beginner to iOS, we suggest you read through The iOS
Apprentice, 3rd Edition first. That will give you a solid foundation in building iOS
apps from the ground-up.
raywenderlich.com Page 10
Core Data by Tutorials Introduction
If you know the basics of iOS development but are new to Swift, we suggest you
read Swift by Tutorials first. That book has a similar hands-on approach and takes
you on a comprehensive tour through the Swift language.
If you’re new to Core Data or want to review the basics, we suggest you start with
Chapters 1–3. These chapters cover the fundamentals of Core Data and you’ll need
the knowledge in them to understand the rest of the book.
What’s in store
Here’s a quick summary of what you’ll find in each chapter:
1. Chapter 1, Your First Core Data App: You’ll click File\New Project and write
a Core Data app from scratch! This chapter covers the basics of setting up your
data model and then adding and fetching records.
2. Chapter 2, NSManagedObject Subclasses: NSManagedObject is the base data
storage class of your Core Data object graphs. This chapter will teach you how
you customize your own managed object subclasses to store and validate data.
3. Chapter 3, The Core Data Stack: Under the hood, Core Data is made up of
many parts working together. In this chapter, you’ll learn about how these parts
fit together, and move away from the starter Xcode template to build your own
customizable system.
4. Chapter 4, Intermediate Fetching: Your apps will fetch data all the time, and
Core Data offers many options for getting the data to you efficiently. This chapter
covers more advanced fetch requests, predicates, sorting and asynchronous
fetching.
5. Chapter 5, NSFetchedResultsController: Table views are at the core of many
iOS apps, and Apple wants to make Core Data play nicely with them! In this
chapter, you’ll learn how NSFetchedResultsController can save you time and code
when your table views are backed by data from Core Data.
raywenderlich.com Page 11
Core Data by Tutorials Introduction
6. Chapter 6, Versioning and Migration: As you update and enhance your app,
its data model will almost certainly need to change. In this chapter, you’ll learn
how to create multiple versions of your data model and then migrate your users
forward so they can keep their existing data as they upgrade.
7. Chapter 7, Syncing with iCloud: Move beyond storing data locally on a single
device, to cloud storage and synchronizing across all the user’s devices. This
chapter covers how to extend an existing Core Data app to use iCloud.
8. Chapter 8, Unit Tests: Testing is an important part of the development
process, and you shouldn’t leave Core Data out of those tests! In this chapter,
you’ll learn how to set up a separate test environment for Core Data and see
examples of how to test your models.
9. Chapter 9, Measuring and Boosting Performance: No one ever complained
that an app was too fast, so it’s important to be vigilant about tracking
performance. In this chapter, you’ll learn how to measure your app’s performance
with various Xcode tools and then pick up some tips for dealing with slow spots in
your code.
10. Chapter 10, Multiple Managed Object Contexts: In this final chapter, you’ll
expand the usual Core Data stack to include multiple managed object contexts.
You’ll learn how this can improve perceived performance and help make your app
architecture less monolithic and more compartmentalized.
Updates
Since you’ve purchased the PDF version of this book, you get free access to any
updates we make to the book!
The best way to get update notifications is to sign up for our monthly newsletter.
This includes a list of the tutorials that came out on raywenderlich.com that month,
any important news like book updates or new books, and a list of our favorite
development links for that month. You can sign up at this URL:
http://www.raywenderlich.com/newsletter
raywenderlich.com Page 12
Core Data by Tutorials Introduction
License
By purchasing Core Data by Tutorials, you have the following license:
• You are allowed to use and/or modify the source code in Core Data by Tutorials in
as many apps as you want, with no attribution required.
• You are allowed to use and/or modify all art, images and designs that are included
in Core Data by Tutorials in as many apps as you want, but must include this
attribution line somewhere inside your app: “Artwork/images/designs: from Core
Data by Tutorials book, available at http://www.raywenderlich.com.”
• The source code included in Core Data by Tutorials is for your personal use only.
You are NOT allowed to distribute or sell the source code in Core Data by
Tutorials without prior authorization.
• This book is for your personal use only. You are NOT allowed to sell this book
without prior authorization or distribute it to friends, co-workers or students; they
would need to purchase their own copies.
All materials provided with this book are provided on an “as is” basis, without
warranty of any kind, express or implied, including but not limited to the warranties
of merchantability, fitness for a particular purpose and non-infringement. In no
event shall the authors or copyright holders be liable for any claim, damages or
other liability, whether in an action of contract, tort or otherwise, arising from, out
of or in connection with the software or the use or other dealings in the software.
All trademarks and registered trademarks appearing in this book are the property of
their respective owners.
raywenderlich.com Page 13
Core Data by Tutorials Introduction
Bradley C. Phillips was the editor for this book, and was
the first editor to come aboard at raywenderlich.com. He
has worked as a journalist and previously directed the
intelligence department of an investigative firm in New
York City. Right now, Bradley works freelance and pursues
his own projects. Contact him if you need a skilled and
experienced editor for your blog, books or anything else.
Greg Heo was the final pass editor for this book, and has
been part of the editorial team at raywenderlich.com since
2012.
raywenderlich.com Page 14
Chapter 1: Your First Core
Data App
By Pietro Rea
Welcome to Core Data! In this chapter, you’ll write your very first Core Data app.
You’ll see how easy it is to get started with all the resources provided in Xcode,
from the starter code templates to the data model editor.
You’re going to hit the ground running right from the first chapter in this book; by
the end of the chapter you’ll know how to:
• model data you want to store in Core Data using Xcode’s model editor;
• add new records to Core Data;
• fetch a set of records from Core Data; and
• display the fetched results to the user in a table view.
You’ll also get a sense of what Core Data is doing behind the scenes, and how you
can interact with the various moving pieces there. This will put you well on your
way to understanding the next two chapters, which continue the introduction to
Core Data with more advanced models and data validation, amongst other things.
Getting started
Open Xcode and create a new iPhone project based on the Single View
Application template. Call the app HitList and make sure Use Core Data is
checked:
raywenderlich.com Page 15
Core Data by Tutorials Chapter 1: Your First Core Data App
Checking the Use Core Data box will cause Xcode to generate boilerplate code for
what’s known as a Core Data stack in AppDelegate.swift.
The Core Data stack consists of a set of objects that facilitate saving and retrieving
information from Core Data. There’s an object to manage the Core Data state as a
whole, an object representing the data model, and so on.
You’ll learn about each of these pieces in these first few chapters. Later, you’ll even
have the chance to write your own Core Data stack! The standard stack works just
fine for many apps but based on your app and its data, you can customize the stack
to be more efficient.
Note: Not all Xcode templates have the option to start with Core Data. In
Xcode 6, only the Master-Detail Application and the Single View
Application templates have the Use Core Data checkbox.
The idea for this sample app is simple. There will be a table view with a list of
names for your very own “hit list”. You’ll be able to add names to this list and
eventually, you’ll use Core Data to make sure the data is stored between sessions.
We don’t condone violence in this book so you can think of this app as a “favorites
list” to keep track of your friends too, of course! ;]
raywenderlich.com Page 16
Core Data by Tutorials Chapter 1: Your First Core Data App
Next, embed the view controller in a navigation controller. From Xcode’s Editor
menu, select Embed In…\ Navigation Controller.
Back in Interface Builder, drag a Table View from the object library into the view
controller so that it covers the entire view.
Then, drag a Bar Button Item and place it on the view controller’s newly added
navigation bar. Finally, double-click the bar button item to change its text to Add.
Your canvas should now look like the following screenshot:
Every time you tap Add on the top-right, an alert containing a text field will appear
on the screen. From there you’ll be able to type someone’s name into the text field.
Dismissing the alert will save the name and refresh the table view with all the
names you’ve saved up to that point.
raywenderlich.com Page 17
Core Data by Tutorials Chapter 1: Your First Core Data App
Before you can do that, you need to make the view controller the table view’s data
source. Ctrl-drag from the table view to the yellow view controller icon above the
navigation bar, as shown below, and click on dataSource:
In case you were wondering, you don’t need to set up the table view’s delegate
since tapping on the cells won’t trigger any action. It doesn’t get simpler than this!
Name the new IBOutlet property tableView, resulting in the following line:
Ctrl-drag from the Add bar button item onto ViewController.swift, but this time,
create an action instead of an outlet and name the method addName:
You can now refer to the table view and the bar button item’s action in code. Next,
set up the model for the table view. Add the following property to
ViewController.swift:
names is a mutable Array to hold the strings for the table view to display.
raywenderlich.com Page 18
Core Data by Tutorials Chapter 1: Your First Core Data App
This will set a title and register the UITableViewCell class with the table view. You
do this so that when you dequeue a cell, the table view will return a cell of the
correct type.
// MARK: UITableViewDataSource
func tableView(tableView: UITableView,
numberOfRowsInSection section: Int) -> Int {
return names.count
}
let cell =
tableView.dequeueReusableCellWithIdentifier("Cell")
as UITableViewCell
cell.textLabel!.text = names[indexPath.row]
return cell
}
If you’ve ever worked with UITableView, this code should look very familiar. The
first method says that the table view will have as many rows as the names array has
strings.
raywenderlich.com Page 19
Core Data by Tutorials Chapter 1: Your First Core Data App
Don’t run the app just yet. First, you need a way to input names so the table view
can display them.
Implement the addName IBAction method you Ctrl-dragged into your code earlier:
alert.addTextFieldWithConfigurationHandler {
(textField: UITextField!) -> Void in
}
alert.addAction(saveAction)
alert.addAction(cancelAction)
presentViewController(alert,
animated: true,
completion: nil)
}
Every time you tap the Add bar button item, this method presents an
UIAlertController with a text field and two buttons, Save and Cancel.
Save takes whatever text is currently in the text field, inserts it into the name array
and reloads the table view. Since the names array is the model backing the table
view, whatever you typed into the text field will appear in the table view.
Finally it’s time to build and run your app for the first time. Tap the Add bar button
item. The alert controller will look like this:
raywenderlich.com Page 20
Discovering Diverse Content Through
Random Scribd Documents
THE ROUT OF THE MAHIKI
The location of the adventure with the shark-god Maka’u-kiu1 was at the
mouth of Wai-pi’o valley, a region where Hawaii’s storm-coast forms an
impassable rampart, save as it is cut by this and its twin valley, Wai-manu.
These valleys take head in a wild forest region, the home of mist, rain and
swamp. Adjoining this and part of the same watershed is the region known
as Mahiki-waena, a land which the convenience of traffic required should
be open to travel. It was the haunt of a ferocious horde of mo’o called
mahiki2 from their power to leap and spring like grass-hoppers.
When Hiiaka proposed to pass through this region in the ordinary course of
travel, the head of the Mahiki insolently denied her the right of way,
suggesting as an alternative the boisterous sea-route around the northern
shoulder of Hawaii. Hiiaka’s blood was up. The victory over the hosts of
Pana-ewa and the more recent destruction of Maka’u-kiu had fired her
courage. She resolved once for all to make an end of this arrogant nuisance
and to rid the island of the whole pestilential brood of imps and mo’o.
Standing on a height that overlooked Wai-pi’o, she chanted a mele which is
at once descriptive of the scene before her and at the same time expressive
of her determination:
Mele Uhau
A luna au o Wai-pi’o,
Kilohi aku k’uu maka ilalo;
Hele ho’i ke ala makai o Maka’u-kiu;
Hele ho’i ke ala mauka o Ka-pu-o’a—
Pihapiha, he’e i ka welowelo,
I ka pu’u Kolea, i ka ino, e—
Ino Mahiki:
Ua ike ka ho’i au, he ino Mahiki,
He ino, he ino loa no, e!
TRANSLATION
Hiiaka’s march to encounter the Mahiki was interrupted for a short time by
an incident that only served to clinch her resolution. An agonizing cry of
distress assailed her ear. It came from a dismantled heap of human flesh, the
remains of two men who had been most brutally handled—by these same
Mahiki, perhaps—their leg and arm-bones plucked out and they left to
welter in their misery. It was seemingly the cruel infliction of the Mahiki.
The cry of the two wretches could not be disregarded:
E Hiiaka-i-ka-poli-o-Pele, e,
E ki’i mai oe ia maua;
E ka hookuli i ka ualo, e!
Ka opu aloha ole, e-e!
TRANSLATION
O Hiiaka-of-Pele’s-heart,
Come thou and assist us.
Turn not a deaf ear to our cry!
Be not of hard and unfeeling heart!
Hiiaka, with a skill that did credit to her surgery, splinted the maimed limbs,
inserting stems from her favorite ti plant to take the place of the long bones
that had been removed. She left them seated in comfort at the roadside at
Pololú.
The Mahiki, on seeing Hiiaka advance into their territory, threw up the dirt
and dust in their front, to express their contempt for such an insignificant
body of trespassers. Hiiaka, paying no attention to their insolence, pressed
on. Her purpose was to strike directly at Mo’o-lau, the leader of the horde,
to whom she addressed this incantation:
A loko au o Mahiki,
Halawai me ke Akua okioki po’o.
Okioki ino, la, i kona po’o;
Kahihi a’e la i kona naau;
Hoale mai ana i kona koko i o’u nei.
E Lau e, Lau e-e!
No’u ke ala, i hele aku ho’i, e-e!
TRANSLATION
At dark Hiiaka camped in the road and during the night a female ku-pua
named Lau-mihi, whom the Mahiki chief had sent as a spy to watch Hiiaka,
was seen standing on a high place to one side of them. Hiiaka at once flew
at her and put an end to her.
Now began a fierce battle between Hiiaka and the Mahiki dragon and his
forces. They fought till both sides were exhausted and then, as if by mutual
consent, stopped to rest.
Hiiaka perceived that the battle was to be even more fiercely contested than
that at Pana-ewa. She bade Paú-o-pala’e to take good care that no ill came
to Wahine-oma’o. Looking up into the heavens, Hiiaka saw her relatives
and friends Poha-kau, Ka-moho-alii, Kane-milo-hai, and a large concourse
of other gods, including Kane, Kanaloa, Ku and Lono, watching her,
evidently greatly interested in her performances. They assured her of their
protection. At this Hiiaka was much encouraged and gave utterance to her
feelings in this kanaenae:
TRANSLATION
At this the great dragon Mo’o-lau bestirred himself. His attack was direct,
but he divided his host into two columns so as to envelope Hiiaka and
attack her on each flank. Hiiaka saw them approaching through the jungle
and chanted the following rallying song:
Mele Ho’-uluulu
TRANSLATION
Pele, perceiving that the crisis of the conflict had now come, called upon all
the male and female relatives of Hiiaka (hoaiku) to go to her assistance;
“Go and help your sister Hiiaka. There she is fighting desperately with
Mo’o-lau—fighting and resting, fighting and resting, well nigh exhausted.
Go and help her; all of you go. It’s a fight against Mo’o-lau.”
When the battalion of gods moved against the mo’o, it was a rout and a
slaughter. Then the cry arose: “No fight has been made against the Mahiki
dragon; he yet survives.” Thereupon they turned their attack against that old
dragon and his guards. Hiiaka then celebrated the double victory in this
paean:
TRANSLATION
Hiiaka’s chief weapon of attack seems to have been her magical paú. With
this as a besom she beat them down as a husbandman might beat down a
swarm of locusts. The Mahiki and the Mo’o-lau had ceased to exist as
organized bodies. But from the rout and slaughter of the armies many
individuals had escaped with their lives, and these had hid themselves away
in caves and secret places, some of them even, presuming apparently upon
their power of disguise, had taken refuge in the remote scattered habitations
of the people. Such an inference seems to be justified by the language of the
mele now to be given:
Note.—The gods that came to the assistance of Hiiaka such times as circumstances pinched her and
whose spiritual power at all times reënforced her feeble humanity were limited in their dominion to
certain vaguely defined provinces and departments. Thus, if there was any sea-fighting to be done, it
fell to the shark-god, the Admiral Ka-moho-alii, to take charge of it. On the other hand, the conduct
of a battle on terra firma would be under the generalship of Kane-milo-hai; while to Kana-loa
belonged the marshalling of the celestial hosts, the moon and the stars. But the orb of day, the Sun,
belonged to Lono. Hence, if the fighting was during the hours of daylight, Lono would logically
assume the command. The rule of the great god Ku was also exercised principally by day. It was he
who arranged the calendar and settled the order of the seasons, the days and the nights. The
subdivisions and departmental complications under these general divisions were numerous.
TRANSLATION
1 Maka’u-kiu, afeared-o-a-spy. ↑
2 Ma-hi-ki (mahiti, mawhiti), to leap, to skip, to spring up suddenly. The Maori Comp.
Dict. E. Tregear. ↑
CHAPTER XIII
HIIAKA LOOPS BACK IN HER JOURNEY
Hiiaka, having thus far, as it would seem, journeyed along the western coast
of Hawaii, now loops back in her course and travels in the direction of Hilo
by the way of Hamakua, for the seeming purpose of completing her work of
extermination. Like a wise general, she would leave no enemies in her rear.
When they came into the neighborhood of Wahine-oma’o’s home, that girl
spoke up and said, “I think we had better take another road. If we keep to
this one, which passes by my door, my parents, who will be watching for
me, will see me and will want me to remain with them.” This she said by
reason of her great desire to continue in Hiiaka’s company. True enough,
when they caught sight of her old home, there sat her mother Puna-hoa and
her father Kai-pala-oa.
“There they sit,” said the girl. “If they recognize me they will want to keep
me.”
Hiiaka bade Wahine-oma’o fall in behind her, hunch her shoulders, bend
forward her head and walk with short infirm steps in imitation of an old
woman. Hiiaka, on coming close to the old people, using the language of
song, asked directions as to the road:
E Puna-hoa i Kai-pala-oa,
I na maka o Nana-kilo ma
E nonoho mai la, e.
Auhea ka ala, e?
TRANSLATION
On reaching the outskirts of the village of Hilo, Hiiaka found a rickety foot-
bridge, consisting of a single narrow and wobbly plank, liable to turn at
every step and precipitate the passenger into the tumbling waters below—
and this was the only passage across the rocky chasm of the Wai-luku1
river. This precarious crossing was the work of two sorcerers, degenerate
nondescripts, who had the audacity to levy toll for the use of their bridge, in
default of which the traveler suddenly found himself precipitated into the
raging water. By virtue of their necromantic powers, they had the
presumption to claim spiritual kinship with Hiiaka, a bond the woman could
not absolutely repudiate.
“Well, what of it? She will have to pay her fare the same as anyone else,”
replied Noho-a-mo’o. “Only on that condition shall she cross by our
bridge.”
Kahuli-huli,3 e-e,
Ka papa o Wai-luku!
Kahuli o Apua,
Ha’a mai o Mau-kele:
He ole ke kaha kuai ai, e-e!
Homai ka ai,
Homai ho’i ka ai, e-e!
I ai’na aku ho’i, e-e!
TRANSLATION
Ka-huli-huli, e-e,
Ka papa o Wai-luku.
He ole ke kaha kuai i’a, e!
Ho-mai ka i’a;
Ho-mai ana, ho’i, ka i’a,
I ai’na aku, ho’i, e-e!
TRANSLATION
TRANSLATION
Hiiaka now openly denounced the two sorcerers as being simply mo’o in
disguise, entirely wanting in those generous feelings that belong to
godhood. “These creatures are simply mo’o. If I attack them, they will run
for their lives.”
True to Hiiaka’s prediction, the mo’o, in abject fear, turned and fled for
their lives at her first threatening move and she now called upon the people
to pursue and destroy them:
TRANSLATION
The meaning of the figure in the first two verses, though obscure, seems to
be that Hilo, so rich in natural beauty, is by that very fact robbed of the
energy to defend herself and cast off the incubus that oppresses her.
As the creatures fled from Hiiaka’s pursuit, their human disguise fell from
them and their real character as mo’o was evident.
“We’ve committed a great blunder,” said Pili-a-mo’o to his mate. “It looks
as if she meant to kill us. Let us apologize for our mistake and conciliate
her with fair words.”
TRANSLATION
She has grown a fine figure,
Our girl from the Fire-pit.
The plentiful rain has made bright
This bud of upland lehua.
Pray choose your road farther inland;
That way will offer good fordage—
This road leave to your ancient kin.
Hiiaka spared not, but pursued them to their cavernous rock-heaps in which
they thought to hide themselves, and, having seized them, rent them
asunder jaw from jaw. Thus did Hiiaka add one more to the score of her
victories in the extermination of the mo’o.
On resuming the journey they came before long to the broad stream of
Honoli’i, which was swimming deep and, in the lack of other means of
crossing, they bundled their clothes, held them above their heads with one
hand and easily made the opposite shore by swimming with the aid of the
other hand.
TRANSLATION
A great fear came upon the ghosts, that the dread goddess would seize them
and pinch out their atomy spark of existence. In their terror, they flew home
and, perched on the shoulders of their mother, besought her to interpose in
their behalf and appease Hiiaka by a suitable offering of luau.
“There burns a fire,” said Wahine-oma’o, as they drew near the house.
“The fire of the ovens built by the ghosts,” Hiiaka answered. “They have
saved themselves from death.”
By the time they reached the house the luau was done to a turn and the
tables were spread. Wahine-oma’o made an oblation to the gods and then
ate of the viands. Hiiaka did not partake of the food.
TRANSLATION
Hono-kane heard, of course, the words that were uttered in his praise and,
being a man of chivalrous instincts as well as of honor, he invited Hiiaka
and Wahine-oma’o to enjoy the hospitalities of his home.
As they sat at a feast spread in her honor, Hiiaka, as was her wont, bowed
her head in prayer with closed eyes, and the others did likewise and when
they opened their eyes and looked, the portion that had been set before
Hiiaka was gone, spirited away.
In the evening it was announced that a canoe was to sail in the early
morning on a voyage to Maui, whereupon Hiiaka secured the promise of a
passage for herself and Wahine-oma’o.
CHAPTER XV
THE VOYAGE TO MAUI
Hiiaka’s voyage across the Ale-nui-haha channel, considered merely as a
sea adventure, was a tame experience. There was no storm, no boistrous
weather, sea as calm as a mill-pond, nothing to fillip the imagination with a
sense of excitement or danger; yet it was far from being an agreeable
experience to the young woman who was now having her first hand-to-hand
tussle with the world.
They had spent the night at the house of one Pi’i-ke-a-nui. In the early
morning their host and a younger man—apparently his son—named Pi’i-ke-
a-iki, made ready their canoe to sail for Maui. Hiiaka, assuming that
passage would be granted both of them, in accordance with a promise made
the previous day, stood ready against the hour of departure. At the last
moment, the younger man, having assisted Wahine-oma’o to her seat in the
bow next to himself, called to his elder, “Pi’i-ke-a-nui, why don’t you show
your passenger to her seat, the one next you?”
“I won’t do it,” Pi’i-ke-a-nui answered groutily. “I find that the canoe will
be overloaded if we take passengers aboard and all our landlord’s freight
will get wet.”
The real reason for this volte-face on the part of the old sailor was that he
had made an unseemly proposition to Hiiaka the night before and she had
repelled him.
Wahine-oma’o, thereupon, left her seat and the canoe started without them.
It was not more than fairly underway, however, when a violent sea struck
the craft and swamped it, and all the loose freight was floating about in the
ocean.
“There, you see! We’d ’ave had better luck with the women aboard.” Such
was the exclamation of Pi’i-ke-a-iki.
It did not take long to convince the old man Pi’i-ke-a-nui, who was captain
of the canoe, that he had invited this disaster on himself, the agent of which,
as he rightly suspected, was none other than the distinguished-looking
young woman who now stood on the beach watching him in his
predicament with unperturbed countenance.
The two men floated their canoe, collected their baggage and came ashore.
When they had got the stuff dry and stowed in the waist of the craft, they
escorted the women aboard, seating Wahine-oma’o, as directed by the
captain, in the bow near Pi’i-ke-a-iki and Hiiaka in the after part, within
arm’s length of Pi’i-ke-a-nui, and they put to sea.
The canoe was a small affair, unprovided with that central platform, the
pola, that might serve as the cabin or quarter deck, on which the passengers
could stretch themselves for comfort. In her weariness, Hiiaka, with her
head toward the bow, reclined her body against the top rail of the canoe,
thus eking out the insufficiency of the narrow thwart that was her seat; and
she fell asleep, or rather, entered that border-land of Nod, in which the
central watchman has not yet given over control of the muscular system and
the ear still maintains its aerial reconnoissance.
The wind, meanwhile, as it caromed aft from the triangular sail of mat,
coquetted with her tropical apparel and made paú and kihei shake like
summer leaves.
Hiiaka, with the utmost coolness, expressed in song her remonstrance and
sarcastic rebuke for this exhibition of inhospitable rudeness:
TRANSLATION
The young man added his protest: “Yes, his whole conduct is, indeed,
shameful, scandalous. He hasn’t the decency to wait till he gets ashore.”
TRANSLATION
A noho ana,
E na hoaiku,
E na hoa haele,
I uka o Ka-li’u-la,
I Moe-awakea.
TRANSLATION
Perhaps it was that Hiiaka failed to manifest in her carriage and department
the dignity and tabu that hedges in an alii or an akua; perhaps the rough
hearted Pi’i-ke-a-nui, sailor-fashion, deemed himself outside the realm of
honor which rules on land. However that might be, as Hiiaka lay decently
covered against the cold wind that drew down the flank of Hale-a-ka-la, this
rude fellow, regardless of every punctilio, stole up to Hiiaka and repeated
his former attempt. Hiiaka caught his hand in mid air and administered this
rebuke:
TRANSLATION
Ka-uwiki, famous in story,
While buffeting ocean’s blows,
Aspires to commerce with heaven.
Moku-hano’s palms, that float
Like a boat in the water,
Are watchful eyes to Hana,
Alert for the passing school:
Your wanton vagrant eye
Is caught in the very act.
The canoe grated on the shingly beach. The two young women, rejoiced to
be free at last from the enforced proximity of ship-board, sprang ashore and
with speedy steps put a distance between themselves and the canoe-house.
“That’s right,” called out the steersman. “Make haste to find a bath. We’ll
join you in a short time.”
CHAPTER XVI
KAPO-ULA-KINA’U, A RELATIVE OF HIIAKA—THE
MAIMED GIRL MANA-MANA-IA-KALU-EA
The canoe-men, having used their utmost expedition in landing the freight
and hauling up the canoe and getting it under cover, hastened to meet the
two women at the rendezvous they had suggested. But they were nowhere
to be found. They had disappeared as completely as though the earth had
swallowed them up. When Pi’i-ke-a-nui asked the people of the village as
to the whereabouts of the two young women who had just now landed as
passengers from the canoe, they one and all denied having set eyes upon
them.
Hiiaka had planned a visit with her sister Kapo; but, on reaching Wailuku,
the house was empty; Kapo and her husband Pua-nui had but just started to
make a ceremonious call on Ole-pau, a famous chief of the district. The
receding figure of Kapo was already hazy in the distance, so that it seemed
more than doubtful if the words of Hiiaka’s message reached the ears for
which they were intended:
TRANSLATION
TRANSLATION
As Hiiaka passed along the cliff that overlooks the wave-swept beach at
Hono-lua, a pitiful sight met her eye, the figure of a woman crippled from
birth—without hands. Yet, in spite of her maimed condition, the brave spirit
busied herself gathering shell-fish; and when a tumbling wave rolled across
the beach she made herself a partner in its sport and gleefully retreated,
skipping and dancing to the words of a song:
TRANSLATION
Search for the hidden meaning of this oli has brought out a marvellous
diversity of opinion. The chief difficulty lies in the interpretation of the
second verse: Ka i’a kahiko pu no me ka wahine, and centers in the
expression kahiko pu. One able critic finds in it an allusion to the
coöperation of women with the men in the work of fishing. Kahiko is a
word of dignity meaning finely apparelled. The addition of the preposition
pu amplifies it and gives it almost the meaning of wrapped together. It
seems probable also that the word i’a, literally fish, is to be taken in an
esoteric sense as a euphemism for man. Putting this interpretation upon it,
the meaning of the expression kahiko pu becomes clear as being wrapped
together, as in the sexual embrace.
The maimed girl kept up her fishing, her light-hearted dancing and singing:
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.
ebookfinal.com