Cocoa Programming for Mac OS X - Aaron Hillegass [152]
updateChangeCount method, NSDocument, 174
uppercaseString, NSString, 75–76
URLs
adding WebView to application, 369–370
opening for Web service, 368–369
user defaults
enabling user to edit, 213–215
NSUserDefaults, 210–211
NSUserDefaultsController, 217
overview of, 207–208
precedence of types, 211
reading and writing from command line, 217–218
setting, 212–213
user interface. See interface layout
userInfo dictionary, 226–227
“uses”, “inherits from” vs., 48
UTExportedTypeDeclarations key, exported UTIs, 175
UTF-8 (Unicode) file encoding, 238
utility area, Interface Builder, 16
UTIs (universal type identifiers)
configuring exported, 170–171
customizing, 303
pasteboards and, 297–300, 303
understanding, 175
V
value transformers, 351
valueForKey method
bindings, 120
key-value coding, 117
key-value observing, 122
variables
inside objects, 5
reading and setting with accessor methods, 50
viewing in debugger, 59–60
view-based table views
bindings, 183–188
vs. cell-based, 191
view classes, object-oriented programming, 129
view controllers. See view swapping
view controllers, in iOS
overview of, 383–385
pushing, 393–395
UITableViewController, 391–393
view swapping
creating view controllers and XIB files, 400–401
overview of, 397–398
resizing window, 403–405
viewDidMoveToWindow, rollovers, 283
views
drag-and-drop to. See drag-and-drop
images and mouse events. See images and mouse events
layers vs., 417
views, custom
cells, 253–254
creating programmatically, 252
drawing with NZBezierPath, 248–250
flipping with isFlipped, 255
keyboard events, 274
overview of, 241
that draw themselves, 243–248
view hierarchy, 241–243
W
weak attribute, properties, 125
_weak variable, blocks, 375–376
__weak qualifier, ARC, 82
weak references
ARC, 81–82
manual reference counting, 72
platforms not supporting ARC, 82
Web services
NSURLConnection class, 361–363
overview of, 359–360
Web view, 369–372, 395
Window Inspector, setting hidesOnDeactivate, 194
window server, 2, 33
windowControllerDidLoadNib: method, 166–169
windowDidLoad method, 203, 214–215
windows
adding sheets to. See sheets
collection of views for, 241
firstResponder of key, 271
iOS app, 383–384
NSUndoManager and, 158
NSWindowController, 167
panels vs.main, 193–194
Word, NSAtrributedString file format, 288
write code, keyboard events, 278–282
writeObjects method, NSPasteboard, 297
writeToPasteboard: method, 298
X
X window server, 2
Xcode
creating new project, 12–14
getting started, 11–12
Interface Builder editor, 4
iPhone and iPad apps using, 383
overview of, 4
XIB files
creating NSFormatters, 342–344
defined, 15
Interface Builder, 17
overview of, 17
translating strings, 239–240
view swapping, 400–401, 403–405
XML parsing
Web services, 359–360
Y
YES
defined, 26
NSArray, 45
NSObject, 44
Z
ZIP archives
listing tar files with .tar and .tgz vs., 460
packaging application for download, 466
zombies, debugging hints, 98
Table of Contents
Preface
Acknowledgments
Chapter 1 Cocoa: What Is It?
A Little History
Tools
Language
Objects, Classes, Methods, and Messages
Frameworks
How to Read This Book
Typographical Conventions
Common Mistakes
How to Learn
Chapter 2 Let’s Get Started
In Xcode
Create a New Project
The main Function
In Interface Builder
The Utility Area
The Blank Window
Lay Out the Interface
The Dock
Create a Class
Create an Instance
Make Connections
A Look at Objective-C
Types and Constants in Objective-C
Look at the Header File
Edit the Implementation File
Build and Run
awakeFromNib
Documentation
What Have You Done?
Chronology of an Application
Chapter 3 Objective-C
Creating and Using Instances
Using Existing Classes
Sending Messages to nil
NSObject, NSArray, NSMutableArray, and