100% found this document useful (1 vote)
34 views38 pages

PDF Cocoa in A Nutshell A Desktop Quick Reference 1st Edition Michael Beam Download

The document provides information about various ebooks available for download, including titles like 'Cocoa in a Nutshell' and 'Python in a Nutshell.' It highlights the features of 'Cocoa in a Nutshell,' which serves as a comprehensive reference for Cocoa's object classes and frameworks. The document also includes links to purchase or download additional ebooks from the website.

Uploaded by

osherheskeo7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
34 views38 pages

PDF Cocoa in A Nutshell A Desktop Quick Reference 1st Edition Michael Beam Download

The document provides information about various ebooks available for download, including titles like 'Cocoa in a Nutshell' and 'Python in a Nutshell.' It highlights the features of 'Cocoa in a Nutshell,' which serves as a comprehensive reference for Cocoa's object classes and frameworks. The document also includes links to purchase or download additional ebooks from the website.

Uploaded by

osherheskeo7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Download the Full Version of the Ebook with Added Features ebookname.

com

Cocoa in a Nutshell A Desktop Quick Reference 1st


Edition Michael Beam

https://ebookname.com/product/cocoa-in-a-nutshell-a-desktop-
quick-reference-1st-edition-michael-beam/

OR CLICK HERE

DOWLOAD NOW

Download more ebook instantly today at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Python in a Nutshell A Desktop Quick Reference 3rd Edition


Edition Alex Martelli

https://ebookname.com/product/python-in-a-nutshell-a-desktop-quick-
reference-3rd-edition-edition-alex-martelli/

ebookname.com

Linux in a nutshell a desktop quick reference 6th ed


Edition Ellen Siever

https://ebookname.com/product/linux-in-a-nutshell-a-desktop-quick-
reference-6th-ed-edition-ellen-siever/

ebookname.com

AppleScript in a nutshell a desktop quick reference 1st ed


Edition Bruce W. Perry

https://ebookname.com/product/applescript-in-a-nutshell-a-desktop-
quick-reference-1st-ed-edition-bruce-w-perry/

ebookname.com

The Cultural Betrayal of Black Women and Girls A Black


Feminist Approach to Healing from Sexual Abuse 1st Edition
Jennifer M. Gómez
https://ebookname.com/product/the-cultural-betrayal-of-black-women-
and-girls-a-black-feminist-approach-to-healing-from-sexual-abuse-1st-
edition-jennifer-m-gomez/
ebookname.com
March to the West The German invasion of France the Low
Countries 1st Edition Gordon L. Rottman

https://ebookname.com/product/march-to-the-west-the-german-invasion-
of-france-the-low-countries-1st-edition-gordon-l-rottman/

ebookname.com

The Anatomy and Biology of the Human Skeleton 7th revised


reprint Edition D. Gentry Steele

https://ebookname.com/product/the-anatomy-and-biology-of-the-human-
skeleton-7th-revised-reprint-edition-d-gentry-steele/

ebookname.com

Planning the New Suburbia Flexibility by Design 1st


Edition Avi Friedman

https://ebookname.com/product/planning-the-new-suburbia-flexibility-
by-design-1st-edition-avi-friedman/

ebookname.com

The Art of Comparison How Novels and Critics Compare 1st


Edition Catherine Brown.

https://ebookname.com/product/the-art-of-comparison-how-novels-and-
critics-compare-1st-edition-catherine-brown/

ebookname.com

Gene Transfer to Animal Cells Advanced Methods 1st Edition


R. M. Twyman

https://ebookname.com/product/gene-transfer-to-animal-cells-advanced-
methods-1st-edition-r-m-twyman/

ebookname.com
The Chemistry Of Radical Polymerization 2nd Edition Graeme
Moad

https://ebookname.com/product/the-chemistry-of-radical-
polymerization-2nd-edition-graeme-moad/

ebookname.com
[ Team LiB ]

• Table of Contents
• Index
• Reviews
• Reader Reviews
• Errata
Cocoa in a Nutshell

By Michael Beam, James Duncan Davidson

Publisher: O'Reilly
Date
: May 2003
Published
ISBN: 0-596-00462-1
Pages: 566

Cocoa in a Nutshell begins with a complete overview of Cocoa's object classes. It provides developers
who may be experienced with other application toolkits the grounding they'll need to start developing
Cocoa applications. A complement to Apple's documentation, it is the only reference to the classes,
functions, types, constants, protocols, and methods that make up Cocoa's Foundation and Application
Kit frameworks, based on the Jaguar release (Mac OS X 10.2).

[ Team LiB ]
[ Team LiB ]

• Table of Contents
• Index
• Reviews
• Reader Reviews
• Errata
Cocoa in a Nutshell

By Michael Beam, James Duncan Davidson

Publisher: O'Reilly
Date
: May 2003
Published
ISBN: 0-596-00462-1
Pages: 566

Copyright
Preface
What Is Cocoa?
How This Book Is Organized
Conventions Used in This Book
How the Quick Reference Was Generated
Comments and Questions
Acknowledgments

Part I: Introducing Cocoa


Chapter 1. Objective-C
Section 1.1. Objects
Section 1.2. Messaging
Section 1.3. Classes
Section 1.4. Creating Object Instances
Section 1.5. Memory Management
Section 1.6. Deallocating Objects
Section 1.7. Categories
Section 1.8. Naming Conventions

Chapter 2. Foundation
Section 2.1. Data
Section 2.2. Key-Value Coding
Section 2.3. Working with Files
Section 2.4. Bundles and Resource Management
Section 2.5. Archiving Objects
Section 2.6. User Defaults
Section 2.7. Notifications
Section 2.8. Operating System Interaction
Section 2.9. Threaded Programming

Chapter 3. The Application Kit


Section 3.1. AppKit Design Patterns
Section 3.2. Nibs
Section 3.3. Application Architecture
Section 3.4. Controls
Section 3.5. Menus
Section 3.6. Sheets
Section 3.7. Drawers
Section 3.8. Toolbars
Section 3.9. Event Handling
Section 3.10. Document-Based Applications

Chapter 4. Drawing and Imaging


Section 4.1. The Role of Quartz
Section 4.2. Coordinate Systems
Section 4.3. Graphics Contexts
Section 4.4. Working with Paths
Section 4.5. Drawing Text
Section 4.6. Working with Color
Section 4.7. Working with Images
Section 4.8. Transformations

Chapter 5. Text Handling


Section 5.1. Text System Architecture
Section 5.2. Assembling the Text System

Chapter 6. Networking
Section 6.1. Hosts
Section 6.2. URL Resources
Section 6.3. Rendezvous Network Services
Section 6.4. Sockets
Section 6.5. NSFileHandle

Chapter 7. Interapplication Communication


Section 7.1. NSPipe

Chapter 8. Other Frameworks


Section 8.1. AddressBook
Section 8.2. The Message Framework
Section 8.3. Disc Recording Frameworks
Section 8.4. Third-Party Frameworks

Part II: API Quick Reference


Chapter 9. Foundation Types and Constants
Section 9.1. Data Types
Section 9.2. Enumerations
Section 9.3. Global Variables
Section 9.4. Constants
Section 9.5. Exceptions

Chapter 10. Foundation Functions


Section 10.1. Assertions
Section 10.2. Bundles
Section 10.3. Byte Ordering
Section 10.4. Decimals
Section 10.5. Java Setup
Section 10.6. Hash Tables
Section 10.7. HFS File Types
Section 10.8. Map Tables
Section 10.9. Object Allocation
Section 10.10. Objective-C Runtime
Section 10.11. Path Utilities
Section 10.12. Points
Section 10.13. Ranges
Section 10.14. Rects
Section 10.15. Sizes
Section 10.16. Uncaught Exceptions
Section 10.17. Zones

Chapter 11. Application Kit Types and Constants


Section 11.1. Data Types
Section 11.2. Enumerations
Section 11.3. Global Variables
Section 11.4. Exceptions

Chapter 12. Application Kit Functions


Section 12.1. Accessibility
Section 12.2. Applications
Section 12.3. Events
Section 12.4. Fonts
Section 12.5. Graphics: General
Section 12.6. Graphics: Window Depth
Section 12.7. Interface Styles
Section 12.8. OpenGL
Section 12.9. Panels
Section 12.10. Pasteboards
Section 12.11. System Beep

Chapter 13. Foundation Classes


NSAppleEventDescriptor
NSAppleEventManager
NSAppleScript
NSArchiver
NSArray
NSAssertionHandler
NSAttributedString
NSAutoreleasePool
NSBundle
NSCalendarDate
NSCharacterSet
NSClassDescription
NSCloneCommand
NSCloseCommand
NSCoder
NSConditionLock
NSConnection
NSCountCommand
NSCountedSet
NSCreateCommand
NSData
NSDate
NSDateFormatter
NSDecimalNumber
NSDecimalNumberHandler
NSDeleteCommand
NSDeserializer
NSDictionary
NSDirectoryEnumerator
NSDistantObject
NSDistantObjectRequest
NSDistributedLock
NSDistributedNotificationCenter
NSEnumerator
NSException
NSExistsCommand
NSFileHandle
NSFileManager
NSFormatter
NSGetCommand
NSHost
NSIndexSpecifier
NSInvocation
NSKeyedArchiver
NSKeyedUnarchiver
NSLock
NSLogicalTest
NSMachBootstrapServer
NSMachPort
NSMessagePort
NSMessagePortNameServer
NSMethodSignature
NSMiddleSpecifier
NSMoveCommand
NSMutableArray
NSMutableAttributedString
NSMutableCharacterSet
NSMutableData
NSMutableDictionary
NSMutableSet
NSMutableString
NSNameSpecifier
NSNetService
NSNetServiceBrowser
NSNotification
NSNotificationCenter
NSNotificationQueue
NSNull
NSNumber
NSNumberFormatter
NSObject
NSPipe
NSPort
NSPortCoder
NSPortMessage
NSPortNameServer
NSPositionalSpecifier
NSProcessInfo
NSPropertyListSerialization
NSPropertySpecifier
NSProtocolChecker
NSProxy
NSQuitCommand
NSRandomSpecifier
NSRangeSpecifier
NSRecursiveLock
NSRelativeSpecifier
NSRunLoop
NSScanner
NSScriptClassDescription
NSScriptCoercionHandler
NSScriptCommand
NSScriptCommandDescription
NSScriptExecutionContext
NSScriptObjectSpecifier
NSScriptSuiteRegistry
NSScriptWhoseTest
NSSerializer
NSSet
NSSetCommand
NSSocketPort
NSSocketPortNameServer
NSSpecifierTest
NSSpellServer
NSString
NSTask
NSThread
NSTimer
NSTimeZone
NSUnarchiver
NSUndoManager
NSUniqueIDSpecifier
NSURL
NSURLHandle
NSUserDefaults
NSValue
NSWhoseSpecifier

Chapter 14. Foundation Protocols


NSCoding
NSComparisonMethods
NSCopying
NSDecimalNumberBehaviors
NSKeyValueCoding
NSLocking
NSMutableCopying
NSObjCTypeSerializationCallBack
NSObject
NSScriptingComparisonMethods
NSScriptKeyValueCoding
NSScriptObjectSpecifiers
NSURLHandleClient

Chapter 15. Application Kit Classes


NSActionCell
NSAffineTransform
NSApplication
NSBezierPath
NSBitmapImageRep
NSBox
NSBrowser
NSBrowserCell
NSButton
NSButtonCell
NSCachedImageRep
NSCell
NSClipView
NSColor
NSColorList
NSColorPanel
NSColorPicker
NSColorWell
NSComboBox
NSComboBoxCell
NSControl
NSCursor
NSCustomImageRep
NSDocument
NSDocumentController
NSDrawer
NSEPSImageRep
NSEvent
NSFileWrapper
NSFont
NSFontManager
NSFontPanel
NSForm
NSFormCell
NSGlyphInfo
NSGraphicsContext
NSHelpManager
NSImage
NSImageCell
NSImageRep
NSImageView
NSInputManager
NSInputServer
NSLayoutManager
NSMatrix
NSMenu
NSMenuItem
NSMenuItemCell
NSMenuView
NSMovie
NSMovieView
NSMutableParagraphStyle
NSNibConnector
NSNibControlConnector
NSNibOutletConnector
NSOpenGLContext
NSOpenGLPixelFormat
NSOpenGLView
NSOpenPanel
NSOutlineView
NSPageLayout
NSPanel
NSParagraphStyle
NSPasteboard
NSPDFImageRep
NSPICTImageRep
NSPopUpButton
NSPopUpButtonCell
NSPrinter
NSPrintInfo
NSPrintOperation
NSPrintPanel
NSProgressIndicator
NSQuickDrawView
NSResponder
NSRulerMarker
NSRulerView
NSSavePanel
NSScreen
NSScroller
NSScrollView
NSSecureTextField
NSSecureTextFieldCell
NSSimpleHorizontalTypesetter
NSSlider
NSSliderCell
NSSound
NSSpellChecker
NSSplitView
NSStatusBar
NSStatusItem
NSStepper
NSStepperCell
NSTableColumn
NSTableHeaderCell
NSTableHeaderView
NSTableView
NSTabView
NSTabViewItem
NSText
NSTextAttachment
NSTextAttachmentCell
NSTextContainer
NSTextField
NSTextFieldCell
NSTextStorage
NSTextTab
NSTextView
NSToolbar
NSToolbarItem
NSTypesetter
NSView
NSWindow
NSWindowController
NSWorkspace

Chapter 16. Application Kit Protocols


NSAccessibility
NSChangeSpelling
NSColorPickingCustom
NSColorPickingDefault
NSComboBoxCellDataSource
NSComboBoxDataSource
NSDraggingDestination
NSDraggingInfo
NSDraggingSource
NSIgnoreMisspelledWords
NSInputServerMouseTracker
NSInputServiceProvider
NSMenuItem
NSMenuValidation
NSNibAwaking
NSOutlineViewDataSource
NSServicesRequests
NSTableDataSource
NSTextAttachmentCell
NSTextInput
NSTextStorageScripting
NSToolbarItemValidation
NSToolTipOwner
NSUserInterfaceValidations
NSValidatedUserInterfaceItem
NSWindowScripting

Method Index
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
XYZ

Part III: Appendix


Appendix A. Appendix: Resources for Cocoa Developers
Section A.1. Apple Documentation
Section A.2. Related Books
Section A.3. Web Sites
Section A.4. Mailing Lists
Section A.5. Partnering with Apple

Colophon
Index
[ Team LiB ]
[ Team LiB ]

Copyright © 2003 O'Reilly & Associates, Inc.

Printed in the United States of America.

Published by O'Reilly & Associates, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.

O'Reilly & Associates books may be purchased for educational, business, or sales promotional use.
Online editions are also available for most titles (http://safari.oreilly.com). For more information,
contact our corporate/institutional sales department: (800) 998-9938 or [email protected].

Nutshell Handbook, the Nutshell Handbook logo, and the O'Reilly logo are registered trademarks of
O'Reilly & Associates, 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
& Associates, Inc. was aware of a trademark claim, the designations have been printed in caps or
initial caps. The association between the image of an Irish setter and the topic of Cocoa is a trademark
of O'Reilly & Associates, Inc.

Apple Computer, Inc. boldly combined open source technologies with its own programming efforts to
create Mac OS X, one of the most versatile and stable operating systems now available. In the same
spirit, Apple has joined forces with O'Reilly & Associates to bring you an indispensable collection of
technical publications. The ADC logo indicates that the book has been technically reviewed by Apple
engineers and is recommended by the Apple Developer Connection.

Apple, the Apple logo, AppleScript, AppleTalk, AppleWorks, Carbon, Cocoa, ColorSync, Finder,
FireWire, iBook, iMac, iPod, Mac, Mac logo, Macintosh, PowerBook, QuickTime, QuickTime logo,
Sherlock, and WebObjects are trademarks of Apple Computer, Inc., registered in the United States
and other countries. The "keyboard" Apple logo ( ) is used with permission of Apple Computer, Inc.

While every precaution has been taken in the preparation of this book, the publisher and authors
assume no responsibility for errors or omissions, or for damages resulting from the use of the
information contained herein.

[ Team LiB ]
[ Team LiB ]

Preface
It's practically impossible to know Cocoa inside and out. There was once a discussion between two
programmers about Cocoa's large APIs: one was a veteran Perl programmer, the other a Cocoa
programmer. The Perl programmer grumbled about the intimidating and verbose Cocoa APIs, saying
there was simply too much to remember. Bemused, the Cocoa programmer retorted: "You don't
remember Cocoa; you look it up!"

The point the Cocoa programmer was trying to impress upon the Perl programmer was that
understanding object-oriented programming (OOP) concepts and the architecture of the frameworks is
more important than remembering the wordy and numerous method and class names in the Cocoa
frameworks.

This book is a compact reference that will hopefully grow worn beside your keyboard. Split into two
parts, Cocoa in a Nutshell first provides an overview of the frameworks that focuses on both common
programming tasks and how the parts of the framework interact with one another. The second part of
the book is an API quick reference that frees you from having to remember method and class names
so you can spend more time hacking code. This book covers the Cocoa frameworks—Foundation and
Application Kit (AppKit)—as of Mac OS X 10.2 (Jaguar).

[ Team LiB ]
[ Team LiB ]

What Is Cocoa?
Cocoa is a complete set of classes and application programming interfaces (APIs) for building Mac OS
X applications and tools. With over 240 classes, Cocoa is divided into two essential frameworks: the
Foundation framework and the Application Kit.

The Foundation framework provides a fundamental set of tools for representing fundamental data
types, accessing operating system services, threading, messaging, and more. The Application Kit
provides the functionality to build graphical user interfaces (GUI) for Cocoa applications. It provides
access to the standard Aqua interface components ranging from menus, buttons, and text fields—the
building blocks of larger interfaces—to complete, prepackaged interfaces for print dialogs, file
operation dialogs, and alert dialogs. The Application Kit also provides higher-level functionality to
implement multiple document applications, text handling, and graphics.

Classes are not the only constituents of the Cocoa frameworks. Some programming tasks, such as
sounding a system beep, are best accomplished with a simple C function. Cocoa includes a number of
functions for accomplishing tasks such as manipulating byte orders and drawing simple graphics.
Additionally, Cocoa defines a number of custom data types and constants to provide a higher degree
of abstraction to many method parameters.

The Cocoa Development Environment


Project Builder and Interface Builder are the two most important applications used in Cocoa
development. Project Builder is the interactive development environment (IDE) for Mac OS X used to
manage and edit source files, libraries, frameworks, and resources. Additionally, it provides an
interface to the Objective-C compiler, gcc, and the GNU debugger, gdb.

Interface Builder is used to create GUIs for Cocoa applications by allowing developers to manipulate UI
components (such as windows and buttons) graphically using drag and drop. It provides assistance for
laying out components by providing visual cues that conform to Apple's Aqua Human Interface
Guidelines. From an inspector panel, the behavior and appearance of these components can be
tweaked in almost every way the component supports. Interface Builder provides an intuitive way to
connect objects by letting the user drag wires between objects. This way, you set up the initial
network of objects in the interface. In addition, you can interface without having to compile a single bit
of code.

Interface components are not the only objects that can be manipulated with Interface Builder. You can
subclass any Cocoa class and create instances of the subclasses. More importantly, you can give these
classes instance variables, known as outlets, and methods, called actions, and hook them up to user
interface components. Interface Builder can then create source files for these subclasses, complete
header files, and an implementation file including stubs for the action methods. There is much more to
Interface Builder and Project Builder than we can cover in this book, but as you can begin to imagine,
the tight integration of these two applications create a compelling application development
environment.

Cocoa Design Patterns


Cocoa uses many design patterns. Design patterns are descriptions of common object-oriented
programming practices. Effective application development requires that you know how and where to
use patterns in Cocoa. Cocoa in a Nutshell discusses these patterns in the context in which they are
used. Here is a brief list of the design patterns you will encounter in the book:
Delegation

In this pattern, one object, the delegate, acts on behalf of another object. Delegation is used to
alter the behavior of an object that takes a delegate. The developer's job is to implement any
number of methods that may be invoked in the delegate. Delegation minimizes the need to
subclass objects to extend their functionality.
Singleton

This pattern ensures that only one object instance of a class exists in the system. A singleton
method is an object constructor that creates an instance of the class and maintains a reference
to that object. Subsequent invocations of the singleton constructor return the existing object,
rather than create a new one.
Notification

Notifications allow decoupling of message senders from multiple message receivers. Cocoa
implements this pattern in the notification system used throughout the frameworks. It is
discussed in Chapter 2.
Model-View-Control

The Model-View-Controller (MVC) pattern is used extensively in the Application Kit to separate
an application into logically distinct units: a model, which knows how to work with application
data, the view, which is responsible for presenting the data to the user, and the controller,
which handles interaction between the model and the view. Chapter 3 discusses MVC in more
detail.
Target/action

The target/action pattern decouples user-interface components, such as buttons and menu
items, with the objects (the targets) that implement their actions. In this pattern, an activated
control sends an action message to its target. Chapter 3 discusses this topic further.
Responder chain

The responder chain pattern is used in the event handling system to give multiple objects a
chance to respond to an event. This topic is discussed in Chapter 3.
Key-value coding

Key-value coding provides an interface for accessing an object's properties indirectly by name.
Chapter 2 covers key-value coding more thoroughly.

Benefits
These days, application developers expect a lot from their tools, and users expect a lot from any
application they use. Any application or application toolkit that neglects these needs is destined for
failure. Cocoa comes through grandly by providing the features needed in applications now and in the
future, including:

Framework-based development

Cocoa development is based on its frameworks: the Foundation framework and the Application
Kit. With framework-based programming, the system takes a central role in the life of an
application by calling out to code that you provide. This role allows the frameworks to take care
of an application's behind-the-scene details and lets you focus on providing the functionality that
makes your application unique.
"For free" features

Cocoa provides a lot of standard application functionality "for free" as part of the frameworks.
These features not only include the large number of user-interface components, but larger
application subsystems such as the text-handling system and the document-based application
architecture. Because Apple has gone to great lengths to provide these features as a part of
Cocoa, developers can spend less time doing the repetitive work that is common between all
applications, and more time adding unique value to their application.
The development environment

As discussed earlier, Project Builder and Interface Builder provide a development environment
that is highly integrated with the Cocoa frameworks. Interface Builder is used to quickly build
user interfaces, which means less tedious work for the developer.

Cocoa's most important benefit is that it lets you develop applications dramatically faster than with
other application frameworks.

Languages
Cocoa's native language is Objective-C. The Foundation and Application Kit frameworks are
implemented in Objective-C, and using Objective-C provides access to all features of the frameworks.
Chapter 1 covers Objective-C in depth.

Objective-C is not, however, the only language through which you can access the Cocoa frameworks.
Through the Java Bridge, Apple provides a way to access the Cocoa frameworks using the Java
language. The Java Bridge does not provide a complete solution since many of Cocoa's advanced
features, such as the distributed objects system, are not available with Java. This book will not discuss
Cocoa application development with Java.

Another option for working with Cocoa is AppleScript. AppleScript has traditionally been associated
with simple scripting tasks, but with Mac OS X, Apple enabled AppleScript access to the Cocoa
frameworks via AppleScript Studio. AppleScript Studio provides hooks into the Cocoa API so scripters
can take their existing knowledge of AppleScript, write an application in Project Builder, and use
Interface Builder to give their applications an Aqua interface—all without having to learn Objective-C.
This exposes Cocoa to a completely new base of Macintosh developers, who know enough AppleScript
to build simple task-driven applications for solving common problems. For more information about
AppleScript Studio, see http://www.apple.com/applescript/studio.

[ Team LiB ]
Random documents with unrelated
content Scribd suggests to you:
the sense of a moved understanding, had always been lacking. “But then,”
she added ingenuously, “I’ve never really been sure, because I’ve never told
anyone my story. Only I take it for granted that, if I haven’t, it’s their fault
rather than mine....” She smiled half-deprecatingly, and my bosom swelled,
acknowledging the distinction. “And now I want to tell you—” she began.
I have said that my love for Mrs. Hazeldean was a brief episode in our
long relation. At my age, it was inevitable that it should be so. The “fresher
face” soon came, and in its light I saw my old friend as a middle-aged
woman, turning grey, with a mechanical smile and haunted eyes. But it was
in the first glow of my feeling that she had told me her story; and when the
glow subsided, and in the afternoon light of a long intimacy I judged and
tested her statements, I found that each detail fitted into the earlier picture.
My opportunities were many; for once she had told the tale she always
wanted to be retelling it. A perpetual longing to relive the past, a perpetual
need to explain and justify herself—the satisfaction of these two cravings,
once she had permitted herself to indulge them, became the luxury of her
empty life. She had kept it empty—emotionally, sentimentally empty—
from the day of her husband’s death, as the guardian of an abandoned
temple might go on forever sweeping and tending what had once been the
god’s abode. But this duty performed, she had no other. She had done one
great—or abominable—thing; rank it as you please, it had been done
heroically. But there was nothing in her to keep her at that height. Her
tastes, her interests, her conceivable occupations, were all on the level of a
middling domesticity; she did not know how to create for herself any inner
life in keeping with that one unprecedented impulse.
Soon after her husband’s death, one of her cousins, the Miss Cecilia
Winter of Washington Square to whom my mother had referred, had died
also, and left Mrs. Hazeldean a handsome legacy. And a year or two later
Charles Hazeldean’s small estate had undergone the favourable change that
befell New York realty in the ’eighties. The property he had bequeathed to
his wife had doubled, then tripled, in value; and she found herself, after a
few years of widowhood, in possession of an income large enough to
supply her with all the luxuries which her husband had struggled so hard to
provide. It was the peculiar irony of her lot to be secured from temptation
when all danger of temptation was over; for she would never, I am certain,
have held out the tip of her finger to any man to obtain such luxuries for her
own enjoyment. But if she did not value her money for itself, she owed to it
—and the service was perhaps greater than she was aware—the power of
mitigating her solitude, and filling it with the trivial distractions without
which she was less and less able to live.
She had been put into the world, apparently, to amuse men and enchant
them; yet, her husband dead, her sacrifice accomplished, she would have
preferred, I am sure, to shut herself up in a lonely monumental attitude,
with thoughts and pursuits on a scale with her one great hour. But what was
she to do? She had known of no way of earning money except by her
graces; and now she knew no way of filling her days except with cards and
chatter and theatre-going. Not one of the men who approached her passed
beyond the friendly barrier she had opposed to me. Of that I was sure. She
had not shut out Henry Prest in order to replace him—her face grew white
at the suggestion. But what else was there to do, she asked me; what? The
days had to be spent somehow; and she was incurably, disconsolately
sociable.
So she lived, in a cold celibacy that passed for I don’t know what
licence; so she lived, withdrawn from us all, yet needing us so desperately,
inwardly faithful to her one high impulse, yet so incapable of attuning her
daily behaviour to it! And so, at the very moment when she ceased to
deserve the blame of society, she found herself cut off from it, and reduced
to the status of the “fast” widow noted for her jolly suppers.
I bent bewildered over the depths of her plight. What else, at any stage of
her career, could she have done, I often wondered? Among the young
women now growing up about me I find none with enough imagination to
picture the helpless incapacity of the pretty girl of the ’seventies, the girl
without money or vocation, seemingly put into the world only to please,
and unlearned in any way of maintaining herself there by her own efforts.
Marriage alone could save such a girl from starvation, unless she happened
to run across an old lady who wanted her dogs exercised and her
Churchman read aloud to her. Even the day of painting wild-roses on fans,
of colouring photographs to “look like” miniatures, of manufacturing lamp-
shades and trimming hats for more fortunate friends—even this precarious
beginning of feminine independence had not dawned. It was inconceivable
to my mother’s generation that a portionless girl should not be provided for
by her relations until she found a husband; and that, having found him, she
should have to help him to earn a living, was more inconceivable still. The
self-sufficing little society of that vanished New York attached no great
importance to wealth, but regarded poverty as so distasteful that it simply
took no account of it.
These things pleaded in favour of poor Lizzie Hazeldean, though to
superficial observers her daily life seemed to belie the plea. She had known
no way of smoothing her husband’s last years but by being false to him; but
once he was dead, she expiated her betrayal by a rigidity of conduct for
which she asked no reward but her own inner satisfaction. As she grew
older, and her friends scattered, married, or were kept away from one cause
or another, she filled her depleted circle with a less fastidious hand. One
met in her drawing-room dull men, common men, men who too obviously
came there because they were not invited elsewhere, and hoped to use her
as a social stepping-stone. She was aware of the difference—her eyes said
so whenever I found one of these newcomers installed in my arm-chair—
but never, by word or sign, did she admit it. She said to me once: “You find
it duller here than it used to be. It’s my fault, perhaps; I think I knew better
how to draw out my old friends.” And another day: “Remember, the people
you meet here now come out of kindness. I’m an old woman, and I consider
nothing else.” That was all.
She went more assiduously than ever to the theatre and the opera; she
performed for her friends a hundred trivial services; in her eagerness to be
always busy she invented superfluous attentions, oppressed people by
offering assistance they did not need, verged at times—for all her tact—on
the officiousness of the desperately lonely. At her little suppers she
surprised us with exquisite flowers and novel delicacies. The champagne
and cigars grew better and better as the quality of the guests declined; and
sometimes, as the last of her dull company dispersed, I used to see her,
among the scattered ash-trays and liqueur decanters, turn a stealthy glance
at her reflection in the mirror, with haggard eyes which seemed to ask:
“Will even these come back tomorrow?”
I should be loth to leave the picture at this point; my last vision of her is
more satisfying. I had been away, travelling for a year at the other end of
the world; the day I came back I ran across Hubert Wesson at my club.
Hubert had grown pompous and heavy. He drew me into a corner, and said,
turning red, and glancing cautiously over his shoulder: “Have you seen our
old friend Mrs. Hazeldean? She’s very ill, I hear.”
I was about to take up the “I hear”; then I remembered that in my
absence Hubert had married, and that his caution was probably a tribute to
his new state. I hurried at once to Mrs. Hazeldean’s; and on her door-step,
to my surprise, I ran against a Catholic priest, who looked gravely at me,
bowed and passed out.
I was unprepared for such an encounter, for my old friend had never
spoken to me of religious matters. The spectacle of her father’s career had
presumably shaken whatever incipient faith was in her; though in her little-
girlhood, as she often told me, she had been as deeply impressed by Dr.
Winter’s eloquence as any grown-up member of his flock. But now, as soon
as I laid eyes on her, I understood. She was very ill, she was visibly dying;
and in her extremity, fate, not always kind, had sent her the solace which
she needed. Had some obscure inheritance of religious feeling awaked in
her? Had she remembered that her poor father, after his long life of mental
and moral vagabondage, had finally found rest in the ancient fold? I never
knew the explanation—she probably never knew it herself.
But she knew that she had found what she wanted. At last she could talk
of Charles, she could confess her sin, she could be absolved of it. Since
cards and suppers and chatter were over, what more blessed barrier could
she find against solitude? All her life, henceforth, was a long preparation for
that daily hour of expansion and consolation. And then this merciful visitor,
who understood her so well, could also tell her things about Charles: knew
where he was, how he felt, what exquisite daily attentions could still be paid
to him, and how, with all unworthiness washed away, she might at last hope
to reach him. Heaven could never seem strange, so interpreted; each time
that I saw her, during the weeks of her slow fading, she was more and more
like a traveller with her face turned homeward, yet smilingly resigned to
await her summons. The house no longer seemed lonely, nor the hours
tedious; there had even been found for her, among the books she had so
often tried to read, those books which had long looked at her with such
hostile faces, two or three (they were always on her bed) containing
messages from the world where Charles was waiting.
Thus provided and led, one day she went to him.

THE END
*** END OF THE PROJECT GUTENBERG EBOOK NEW YEAR'S DAY
(THE 'SEVENTIES) ***

Updated editions will replace the previous one—the old editions will
be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright in
these works, so the Foundation (and you!) can copy and distribute it
in the United States without permission and without paying
copyright royalties. Special rules, set forth in the General Terms of
Use part of this license, apply to copying and distributing Project
Gutenberg™ electronic works to protect the PROJECT GUTENBERG™
concept and trademark. Project Gutenberg is a registered trademark,
and may not be used if you charge for an eBook, except by following
the terms of the trademark license, including paying royalties for use
of the Project Gutenberg trademark. If you do not charge anything
for copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such as
creation of derivative works, reports, performances and research.
Project Gutenberg eBooks may be modified and printed and given
away—you may do practically ANYTHING in the United States with
eBooks not protected by U.S. copyright law. Redistribution is subject
to the trademark license, especially commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the free


distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund
from the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only be


used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law
in the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name associated
with the work. You can easily comply with the terms of this
agreement by keeping this work in the same format with its attached
full Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.

1.E. Unless you have removed all references to Project Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears,
or with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:
This eBook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this eBook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is derived


from texts not protected by U.S. copyright law (does not contain a
notice indicating that it is posted with permission of the copyright
holder), the work can be copied and distributed to anyone in the
United States without paying any fees or charges. If you are
redistributing or providing access to a work with the phrase “Project
Gutenberg” associated with or appearing on the work, you must
comply either with the requirements of paragraphs 1.E.1 through
1.E.7 or obtain permission for the use of the work and the Project
Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is posted


with the permission of the copyright holder, your use and distribution
must comply with both paragraphs 1.E.1 through 1.E.7 and any
additional terms imposed by the copyright holder. Additional terms
will be linked to the Project Gutenberg™ License for all works posted
with the permission of the copyright holder found at the beginning
of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files containing a
part of this work or any other work associated with Project
Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute this


electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the Project
Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™ works
unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or providing


access to or distributing Project Gutenberg™ electronic works
provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™


electronic work or group of works on different terms than are set
forth in this agreement, you must obtain permission in writing from
the Project Gutenberg Literary Archive Foundation, the manager of
the Project Gutenberg™ trademark. Contact the Foundation as set
forth in Section 3 below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on, transcribe
and proofread works not protected by U.S. copyright law in creating
the Project Gutenberg™ collection. Despite these efforts, Project
Gutenberg™ electronic works, and the medium on which they may
be stored, may contain “Defects,” such as, but not limited to,
incomplete, inaccurate or corrupt data, transcription errors, a
copyright or other intellectual property infringement, a defective or
damaged disk or other medium, a computer virus, or computer
codes that damage or cannot be read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for


the “Right of Replacement or Refund” described in paragraph 1.F.3,
the Project Gutenberg Literary Archive Foundation, the owner of the
Project Gutenberg™ trademark, and any other party distributing a
Project Gutenberg™ electronic work under this agreement, disclaim
all liability to you for damages, costs and expenses, including legal
fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR
NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR
BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH
1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK
OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL
NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT,
CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF
YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of receiving
it, you can receive a refund of the money (if any) you paid for it by
sending a written explanation to the person you received the work
from. If you received the work on a physical medium, you must
return the medium with your written explanation. The person or
entity that provided you with the defective work may elect to provide
a replacement copy in lieu of a refund. If you received the work
electronically, the person or entity providing it to you may choose to
give you a second opportunity to receive the work electronically in
lieu of a refund. If the second copy is also defective, you may
demand a refund in writing without further opportunities to fix the
problem.

1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted
by the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation,


the trademark owner, any agent or employee of the Foundation,
anyone providing copies of Project Gutenberg™ electronic works in
accordance with this agreement, and any volunteers associated with
the production, promotion and distribution of Project Gutenberg™
electronic works, harmless from all liability, costs and expenses,
including legal fees, that arise directly or indirectly from any of the
following which you do or cause to occur: (a) distribution of this or
any Project Gutenberg™ work, (b) alteration, modification, or
additions or deletions to any Project Gutenberg™ work, and (c) any
Defect you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new computers.
It exists because of the efforts of hundreds of volunteers and
donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project Gutenberg™’s
goals and ensuring that the Project Gutenberg™ collection will
remain freely available for generations to come. In 2001, the Project
Gutenberg Literary Archive Foundation was created to provide a
secure and permanent future for Project Gutenberg™ and future
generations. To learn more about the Project Gutenberg Literary
Archive Foundation and how your efforts and donations can help,
see Sections 3 and 4 and the Foundation information page at
www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-profit
501(c)(3) educational corporation organized under the laws of the
state of Mississippi and granted tax exempt status by the Internal
Revenue Service. The Foundation’s EIN or federal tax identification
number is 64-6221541. Contributions to the Project Gutenberg
Literary Archive Foundation are tax deductible to the full extent
permitted by U.S. federal laws and your state’s laws.

The Foundation’s business office is located at 809 North 1500 West,


Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up
to date contact information can be found at the Foundation’s website
and official page at www.gutenberg.org/contact

Section 4. Information about Donations to


the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission of
increasing the number of public domain and licensed works that can
be freely distributed in machine-readable form accessible by the
widest array of equipment including outdated equipment. Many
small donations ($1 to $5,000) are particularly important to
maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws regulating


charities and charitable donations in all 50 states of the United
States. Compliance requirements are not uniform and it takes a
considerable effort, much paperwork and many fees to meet and
keep up with these requirements. We do not solicit donations in
locations where we have not received written confirmation of
compliance. To SEND DONATIONS or determine the status of
compliance for any particular state visit www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states where


we have not met the solicitation requirements, we know of no
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot make


any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.

Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.
Project Gutenberg™ eBooks are often created from several printed
editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.
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.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like