Cocoa Programming for Mac OS X - Aaron Hillegass [141]
• Mark Dalrymple wrote a book on the plumbing of Mac OS X from a developer’s point of view. If your code is going to do anything with the operating system (such as multithreading or networking), we strongly recommend that you pick up a copy of Advanced Mac OS X Programming.
• Don’t be afraid to experiment—most questions can be answered by creating a tiny application. Creating this application will probably take you less than 15 minutes.
• The Web site for this book (www.bignerdranch.com/books) has the answers to many questions and several fun examples.
• Stack Overflow (www.stackoverflow.com/) is an excellent place to find the answers to your questions, and has a strong Cocoa and iOS presence. Chances are somebody has faced the same challenge you are facing.
• The CocoaDev Wiki (www.cocoadev.com/) is a good place to learn new tricks.
• Apple also has a mailing list for Cocoa developers. You can join the cocoa-dev mailing list at Apple’s list server (http://lists.apple.com/). The list is archived at www.cocoabuilder.com/.
• If you have exhausted all other possibilities, Apple’s Developer Technical Support will answer your questions for a fee. The folks there have answered lots of questions for us, and we find them to be consistently knowledgeable and helpful.
• Join the Apple Developer Connection. It will give you access to the latest developer tools and documentation, as well as prior years’ WWDC videos. The ADC Web site is http://developer.apple.com/.
• When you’re ready to learn more about Cocoa, the forthcoming More Cocoa Programming for Mac OS X will help you take your Mac applications to the next level, with an emphasis on more advanced topics such as custom controls and making your application scriptable using AppleScript.
Finally, try to be nice. Help beginners. Give away useful applications and their source code. Answer questions in a kind manner. It is a relatively small community, and few good deeds go forever unrewarded.
Thanks for reading our book!
Index
Symbols
: (colon), method name with arguments, 36
@“...” construct, 47
@ symbol
C strings vs. NSStrings, 40–41
Objective-C keywords, 27
^operator, blocks, 372, 374
A
abstract class
defined, 160
NSCoder as, 160
NSController as, 129–130
acceptsFirstResponder method, keyboard events, 272–275, 280, 282
accessor methods
declaring for new class, 50–51
defined, 50
implementing, 123–125
actions
implicit animation and, 423–424
targets and. See target/action
actions
dictionary, 423
addObject method
add objects to end of array, 36
NSMutableArray, 46
addObjectsFromArray: method, NSMutableArray, 46
addOperationWithBlock: method, NSOperationQueue, 436–437
Alert panel
as modal window, 336–337
overview of, 229–230
using string table, 241
alloc method
coupling with init message, 43–44
retain-count rules for ownership, 76
retain count using, 69
AppKit framework.
classes with delegates in, 112
defined, 6
UIKit vs. See iOS development
applications
debugging hints, 98
as directories, 172
distributing your. See distributing your application
ARC (automatic reference counting)
benefits and limitations, 68–69
defined, 68
disabling, 63–64
overview of, 80–81
strong references, 81
weak references, 81–82
archiving
automatic document saving, 174
document architecture, 163–167
loading and NSKeyedArchiver, 168–169
NSCoder and NSCoding, 160–163
overview of, 159–160
preventing infinite loops, 172–173
saving and NSKeyedArchiver, 167–168
arguments
initializers with, 56–58
methods taking, 36–37
arrangedObjects controller key, array controller, 136
array controllers
NSArrayController. See NSArrayController
arrays
methods implemented by NSArray, 45
methods implemented by NSMutableArray, 46
asserts, debugging with, 61–62
assign attribute, properties, 125
Assistant