Mac OSX Developer Guide book cover

Mac OSX Developer Guide

Mac OS X, Apple's newest operating system for the Macintosh platform, is profoundly different from its earlier versions because of its similarity to the UNIX operating system. For developers writing software for OS X this means adjusting to two new environments to create applications and to access the enhanced features of the new OS, Cocoa and Carbon. Cocoa is an object-oriented API in which all future OS X programs will be written. Carbon is a transitional technology allowing compatibility of applications written for earlier versions of the Mac OS with Mac OS X.Mac OS X Developer's Guide focuses equally on Cocoa and Carbon, guiding the reader through these technologies and showing how to write applications in both. It is the first book for Mac OS X developers written for those who are already working on applications, as well as new developers just getting started. It starts off describing the new OS and its development tools then focuses on specific programming issues, providing tips on making the transition from classic Mac OS code to Mac OS X.

Audience
Apple Macintosh OS Developers

,

Published: October 2001

Imprint: Morgan Kaufmann

ISBN: 978-0-12-251341-1

Contents

  • Preface.Other Documentation.Aqua Interface Elements.About the Book.Acknowledgments.Introducing Mac OS X:1. Introduction.Who Is a Programmer?The Search for Better Ways to Write SoftwareImproving the Production of CodeReusing Code System Software AbstractionThe Evolution of Software Increasing Complexity of SoftwareSoftware for the Twenty-first CenturySummary2. Architecture Overview.The Story So Far...Personal Computer Operating SystemsSharingModern Operating SystemsSecurityProcess Management Memory Management Communication Between and Among Processes Failure and Exception HandlingKernel ArchitectureMachTasks and Threads Memory Management Communication Between and Among Tasks Mach and Other Operating SystemsThe Evolution of Mac OS X The Beginnings of Operating SystemsCommon InterfacesManaging ChangesThe Object-Oriented/Flat World Boundary Splitting the Operating SystemSummary3. Frameworks and Object-Oriented Programming.Object-Oriented ProgrammingWhy Is It Liked?Where Are the Benefits?The Learning CurveObjectsObject-Oriented Design IssuesInheritancePolymorphismData Hiding and Encapsulation What It Means¿No If Statements An ExamplePerformanceRun-Time IssuesDynamism Managing Objects in MemoryFrameworksSummary4. The Languages of Mac OS X: Java.The Look of JavaUnicodeJava Isn't CEverything Is an ObjectObject ClassSome Java SyntaxInheritance and Organization in JavaPackages Frameworks and Java Exception HandlingThe Java BridgeBridge Performance IssuesFinding Java HeadersSummary5. The Languages of Mac OS X: Objective-C.Object-Oriented Programming Languages: Two DirectionsObjects and Messages The Look of the LanguagesDynamism Dynamic TypingDynamic Binding Dynamic LinkingClass and Instance ObjectsCreating New InstancesUsing Class ObjectsProtocols CategoriesKeeping It RunningSyntaxSummary6. The Languages of Mac OS X: C++.The C++ ObjectiveConsequences of Compile-Time TypingSmall Objects Are Not ExpensiveThe Fragile Base Class ProblemRun-time Type Identification and Exception HandlingMultiple InheritanceThe History of Multiple Inheritance in C++ C++ DelegationUsing Objective-C and C++ Together (Objective-C++)Summary7. The Frameworks of Mac OS X: Cocoa.Programming Design TerminologyObjects EventsActionsRespondersResponder ChainDelegatesOutletsConnections ActionsAppKit Interface Fonts GraphicsColorDocuments PrintingOperating SystemInternational Interface BuilderFoundationNSObjectValuesStrings CollectionsOperating System ServicesNotifications Archiving Objective-C Language ServicesScriptingDistributed ObjectsSummary8. The Frameworks of Mac OS X: Carbon.Where Carbon Fits InClassicMach-O and CFMCarbon as a Mac OS X PreviewCarbon as a Classic Porting ToolCarbon for Good CodeCarbon for MaintenanceCarbon FrameworksCarbon FrameworksApplication Services Core ServicesCarbon EventsOld-Style Events (WaitNextEvent)Direct Dispatching with Carbon EventsSummary9. The Frameworks of Mac OS X: Core Foundation and Apple Class Suites.Core Foundation Core Foundation Syntax Opaque TypesCreating and Copying Core Foundation Objects Memory Management and Thread SafetyCore Foundation ServicesApple Class SuitesMacAppMacApp Design Considerations Browsing MacApp in CodeWarrior Differences Between MacApp and CocoaSummaryDesigning for Mac OS X:10. Planning Your Project.Set Your Objectives Justify the ProjectDevelop Proofs-of-ConceptKnow Your UserUse Appropriate Language Build a Usable InterfaceConsider the Non-Interactive UserBuilding on the PastChoose Your Resources People Development EnvironmentFrameworkLanguageUse Mac OS X FeaturesUser ExperienceApplication StructureSummary11. The Tools of Mac OS X: Project Builder.Getting Started with Project Builder Using an Integrated Development Environment (IDE)Where Project Builder Comes FromWhen to Use Project Builder Using the Command LineUsing Project Builder Project Structure PaneEditor PaneTool PaneConfiguring the ToolbarCreating a New ProjectCreating a New FileBuilding ProjectsFiles and Build PhasesBuild SettingsApplication SettingsExecutablesBuild StylesUsing TargetsBuilding From the Command LineWorking with CodeWarriorUsing CodeWarrior with MacAppExporting Projects from CodeWarriorSummary12. The Tools of Mac OS X: Interface Builder.Interface Builder OverviewCocoa and Carbon NibsMain Nib FileAdditional Nib FilesHooks for Nib File CreationNib Windows in Interface BuilderUsing Interface ElementsMenusConnecting Interface Elements for ActionsWindowsConnecting Interface Elements for OutletsViewsDesigning with Interface BuilderProgramming for Interface BuilderActionsOutletsConnecting Outlets First ResponderInstantiating Controllers and Other ObjectsUsing Interface Builder with CarbonWorking with Interface Builder and CarbonProgramming for Carbon NibsSummary13. Prototyping and TestingThe Roles of PrototypesPrototyping Development ToolsVisualization of ConceptsProcess DefinitionAdvance VersionsTrainingSkunkworksShaping the InterfaceUsing Interface Builder for PrototypesUsing Interface LabsPreserving InnocentsTestingUnit Testing System TestingPrimary FunctionalityTesting FailuresTesting Interface ErrorsTest Suites and Regression TestingPublic/Beta TestingUser TestingSummary14. Developing Help and Assistance.Providing HelpDocumentationAdvertisingOnscreen InformationAspects of HelpHelp ButtonsTool Tips and Help TagsContextual MenusHelp MenuHelp ViewerSearching and Indexing HelpAnchors and URLsHelp Viewer ContentsInstalling HelpSummary15. Packaging Your Application.Packages, Bundles, and Installation LocationsInstallation LocationsDrag-and-Drop InstallationInstallation PackagesCreating an Application Bundle with Project BuilderCreating a Disk ImageCreating an Installer PackageSetting Up Your FilesUsing a Read Me FileUsing a LicenseTesting InstallationsSummary16. Managing Your Code.How Source Code Management WorksSetting Up CVSCreate Your CVS Repository DirectoryImport Your ProjectCheck Out Your ProjectUsing Source Code Management in Project BuilderFile StatusVersion Info Comparing FilesChecking Files In (Commit)RevertingCVS PreferencesLogging In to a Remote CVS ServerSummaryWriting for Mac OS X:17. Applications.A Walk-Through of DiaryWhat Diary DoesDiary EntriesDrawers for NotesToolbarsDiary Data StructureWhere To Put the DataA Walk-Through of the Diary ClassesDiaryDocumentDiaryDataDiaryEntryUsing NSApplicationNSApp¿The Application ObjectApplication DelegationApplication NotificationsApplications in Carbon and ClassicMacApp and TApplicationApplications Without FrameworksSummary18. Building Blocks and Types.Creating a Data StrategyFactoring Data and Interface ElementsFishing Data Through the ObjectsImplementing the StrategyBasic Types and Objects CollectionsArraysDictionaries Sets Mutable CollectionsProperty ListsPreferences and DefaultsDefault DomainsPreference NamesSetting PreferencesUsing PreferencesCreating ObjectsSummary19. Making It Happen: Events, Responders, Delegates and Notification.EventsTypes of EventsEvent FormatsTimersRespondersWorking with the First ResponderSelectorsSending ActionsDelegatesNotificationUsing Delegates and NotificationsReceiving a Notification in a DelegateRegistering for NotificationsPosting a NotificationDelegates versus NotificationsSummary20. Visualization (Views and Windows).Looking at ViewsView HierarchiesView GeometryResizing ViewsDrawingEvents, Mouse Handling, and Scrolling Identifying ViewsAdding ViewsRemoving ViewsUsing WindowsWindow Delegate MethodsWindow NotificationsGeometryWindow ControllersCreating and Loading WindowsWorking with ImagesNSImage NSImageRepImplementing ToolbarsDeclare Toolbar Item NamesSet Default Toolbar ItemsSet Allowed Toolbar ItemsCreate the ToolbarCreate Toolbar Items For Response to User ClicksDrawersSummary21. Interface Design and Controls.The Role of Guidelines and StandardsUser Actions Push Buttons Round ButtonsRounded Bevel Buttons Square ButtonsRadio Buttons and Check Boxes SteppersUser InputText FieldsText ViewsImage InputColor WellChoicesProviding Information to the User Displaying TextDisplaying ProgressOrganizing InformationSmall Control VariantsSummary22. Living in a Shared Environment.Archiving, Serialization, and DistributionTerminology Archiving SerializingCreating Objects from Serialized DataDistributionCopyingCopyingSynchronismKinds of SynchronismOpportunities for SynchronismLockingThreadingTasksConnectionsSummary23. Documents and Files.Document-based ArchitecturesImplementing Documents and ViewsDocument HeaderConstructorWorking with the Window ControllerSaving and Restoring Data Saving Documents Restoring DataUndo and Dirty DocumentsCreate Basic ActionsRegister Undo ActionsClear the Undo Stack Dirtying DocumentsSummary24. Managing Menus.Menus and Other Interface ElementsContextual Menus Dock Menus Quit Show in Finder Keep in Dock WindowsSummary25. Printing.Basic Printing Using the Displayed ViewUsing a Special ViewPrint PanelsPrint InfoPDF and Clipboard SupportSummary26. Action! Games and Multimedia.Human Interface Device (HID) Manager Create a Mach Port Find All Devices on the Port Create an Interface to a Device Open the DeviceCommunicateClose the DeviceFree the Mach PortIdentifying DevicesNSMovie and NSMovieViewNSMovieNSMovieViewImmersive ApplicationsSummary27. Writing and Using Services.How Services Work The Basic Service Structure Other Types of Services How It HappensBusiness Models for ServicesSetting Up a ServiceProperty List SettingsWriting the CodeSummary28. Scripting in Mac OS X.AppleScript OverviewClasses and CommandsScripting Functionality and InterfaceUses of ScriptingMaking Your Application ScriptableBuilding the GrammarImplementing the GrammarsClasses CommandsSummary29. Writing Reusable Components.FrameworksWhy Use a Framework How Frameworks RunCreating a FrameworkVersioning the FrameworkPalettesThe Object Itself IBPalette IBInspectorSummaryIndex.

Advertisement

advert image