Cocoa Programming: a Quick-Start Guide for Developers

Total Page:16

File Type:pdf, Size:1020Kb

Cocoa Programming: a Quick-Start Guide for Developers What Readers Are Saying About Cocoa Programming: A Quick-Start Guide for Developers Cocoa Programming is powerful because Daniel Steinberg teaches us the brilliant way Cocoa and Objective C are constructed and commonly used—just what you’d expect from a seasoned, native, local resident. Eric Freeman Author, Head First Design Patterns Over the years, as a programmer experienced in many different languages and paradigms, I’ve come to dread the process of learning new programming languages and technologies. It’s really hard to find a teacher who can speak to experienced programmers without boring us to tears with oversimplification or taking too much prior knowledge for granted. In this book, Daniel Steinberg has proven to be such a teacher. Cocoa Programming exposes the beauty of the Cocoa environment with just enough detail and explanation to help you “get it” the first time. Chad Fowler CTO, InfoEther, Inc. If you are writing applications for the Mac, the iPhone, or the exciting new iPad, this book will get you started. The programming model for all three platforms is essentially the same, and this book will teach it to you. Get this book so you have a solid foundation to write the next big hit. Bill Dudney Gala Factory Software This book is perfect for seasoned developers looking to get started with Cocoa development. Daniel gives you a solid foundation that will allow you to build the next great Mac or iPhone application. James Frye Developer, Tasty Cocoa Software LLC If you’re new to Mac programming or switching from iPhone development, start reading this book now! Cocoa Programming covers topics other books don’t and puts it all together through great examples where you actually learn it and don’t just read it. Jake Behrens Software Engineer, Snafl As a recently initiated iPhone developer with several applications under my belt (and seasoned web applications developer), this book was a perfect fit for my desire to use my knowledge to create robust, functional, and lightweight Cocoa applications. Daniel Steinberg captured my attention early on with his brilliance and kept me intrigued from one chapter to the next. I had no choice but to write my first Cocoa application while reading and felt I walked away with more than just a solid foundation upon which to build. This book will be a mainstay in my library for sure. Kevin J. Garriott Developer II—Mobile Applications, Rockfish Interactive One of the best flowing programming books I’ve ever read. The chapters just naturally follow one after another. The book is a whole, in much the same way the Cocoa framework is a whole. Both reflect a single, clear, concise voice. Craig Castelaz Principle Software Engineer Cocoa Programming A Quick-Start Guide for Developers Daniel H Steinberg The Pragmatic Bookshelf Raleigh, North Carolina Dallas, Texas Many of the designations used by manufacturers and sellers to distinguish their prod- ucts are claimed as trademarks. Where those designations appear in this book, and The Pragmatic Programmers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g device are trademarks of The Pragmatic Programmers, LLC. Every precaution was taken in the preparation of this book. However, the publisher assumes no responsibility for errors or omissions, or for damages that may result from the use of information (including program listings) contained herein. Our Pragmatic courses, workshops, and other products can help you and your team create better software and have more fun. For more information, as well as the latest Pragmatic titles, please visit us at http://www.pragprog.com Copyright © 2010 Daniel H Steinberg. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmit- ted, in any form, or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior consent of the publisher. Printed in the United States of America. ISBN-10: 1-9343563-0-1 ISBN-13: 978-1-9343563-0-2 Printed on acid-free paper. P1.0 printing, April 2010 Version: 2010-4-22 Contents 1 Introduction 15 1.1 Moving In ........................... 15 1.2 Learning the Language ................... 18 1.3 Installing the Tools ..................... 19 1.4 Exploring the Frameworks . 20 1.5 In This Book ......................... 21 2 Using What’s There 24 2.1 Creating Your Project in Xcode . 25 2.2 Creating the Appearance with Interface Builder . 26 2.3 Testing the Interface with the Cocoa Simulator . 31 2.4 Finishing the Interface ................... 33 2.5 Wiring Up the Components . 35 2.6 Fixing the Build ....................... 39 2.7 Sharing Your Browser ................... 41 2.8 Exercise: Rinse and Repeat . 42 2.9 The Nib File ......................... 43 3 Methods and Parameters 48 3.1 Sending Messages Without Arguments . 48 3.2 Reading the Docs ...................... 50 3.3 Methods with Arguments . 53 3.4 Dynamic Binding ...................... 56 3.5 Problems Sending Messages . 57 3.6 Links Back to Yourself ................... 58 3.7 Exercise: Multiple Connections . 59 4 Classes and Objects 62 4.1 Creating “Hello, World!” . 62 4.2 Logging Output to the Console . 63 4.3 Using an Existing Class . 66 4.4 Refactoring Code ...................... 69 4.5 Creating a New Class .................... 72 CONTENTS 8 4.6 Creating and Using a Class Method . 75 4.7 Creating a New Object ................... 76 4.8 Further Refactoring ..................... 78 4.9 Initializing Your Objects . 79 4.10 Logging Objects ....................... 82 4.11 Exercise: Other Initializations . 83 4.12 Solution: Other Initializations . 84 5 Instance Variables and Properties 86 5.1 Pointers ............................ 87 5.2 Working with Nonobject Types . 88 5.3 Getters and Setters ..................... 89 5.4 Converting the Accessors to Properties . 92 5.5 Dot Notation ......................... 93 5.6 Property Attributes ..................... 96 5.7 Exercise: Adding Properties . 98 5.8 Solution: Adding Properties . 99 5.9 Removing Instance Variables . 100 6 Memory 102 6.1 Reference Counting . 103 6.2 Finding Leaks with the Clang Static Analyzer . 104 6.3 Fixing the Memory Leak on Mac OS X . 106 6.4 Properties and Garbage Collection . 107 6.5 Creating a Flashlight . 109 6.6 Finding Leaks in Instruments . 111 6.7 Fixing the Memory Leak on the iPhone . 112 6.8 Using Zombies . 113 6.9 Cleaning Up in dealloc . 115 6.10 Retain and Release in a Setter . 116 6.11 The Autorelease Pool . 117 6.12 Using Convenience Constructors . 120 6.13 Exercise: Creating and Using a Convenience Constructor 121 6.14 Solution: Creating and Using a Convenience Constructor 122 7 Outlets and Actions 124 7.1 The Big Picture . 125 7.2 Using an Outlet . 125 7.3 Exercise: Creating and Using an Outlet . 128 7.4 Solution: Creating and Using an Outlet . 129 7.5 Declaring an Action . 130 7.6 Connecting and Implementing the Action . 133 Report erratum this copy is (P1.0 printing, April 2010) CONTENTS 9 7.7 Exercise: Hiding the Button . 135 7.8 Solution: Hiding the Button . 135 7.9 Exercise: Toggling the Interface . 136 7.10 Solution: Toggling the Interface . 136 7.11 Introducing Another Outlet . 137 7.12 Creating Selectors from Strings . 139 8 Creating a Controller 141 8.1 How We’ve Created Objects . 141 8.2 Creating Our Controller Class . 143 8.3 Creating an Instance of Our Controller in IB . 144 8.4 Declaring an Outlet and an Action . 146 8.5 Forward Declaration . 149 8.6 Wiring Up the Controller . 150 8.7 Implementing the Loading of the Previous Page . 150 8.8 Exercise: Finishing the Controller . 150 8.9 Solution: Finishing the Controller . 151 8.10 Awake from Nib . 152 8.11 Disabling and Enabling the Buttons . 153 8.12 Still Needs Work . 156 9 Customizing with Delegates 158 9.1 Understanding Delegates . 158 9.2 The Default Window Behavior . 162 9.3 Turning the Background Red . 162 9.4 Exercise: Turning the Background Green . 165 9.5 Solution: Turning the Background Green . 165 9.6 Application Delegate . 165 9.7 Delegates for Your Web View . 166 9.8 Setting the Window Title . 167 9.9 Exercise: Updating the URL and Setting Buttons . 169 9.10 Solution: Updating the URL and Setting Buttons . 170 9.11 Cleaning Up . 170 9.12 Exercise: Adding a Progress Indicator . 173 9.13 Solution: Adding a Progress Indicator . 173 10 Adapting Our Browser to the iPhone 175 10.1 Creating the iPhone Project . 175 10.2 Creating the Look of Our Browser . 177 10.3 The WebView’s Limitations . 178 10.4 Loading a Web Page at Launch . 179 10.5 Tweaking the Text Field in IB . 181 Report erratum this copy is (P1.0 printing, April 2010) CONTENTS 10 10.6 Using the Text Field Delegate . 183 10.7 Using a Third Delegate to Implement the Buttons . 184 10.8 Exercise: Adding an Activity Indicator . 185 10.9 Solution: Adding an Activity Indicator . 186 10.10 Organizing with Pragma Marks . 188 11 Posting and Listening for Notifications 191 11.1 Exercise: Creating a Model . 192 11.2 Solution: Creating a Model . 192 11.3 Registering for Notifications . 194 11.4 Responding to Workspace Activity . 195 11.5 Holding on to the Controller . 197 11.6 Exercise: Registering for Notifications . 198 11.7 Solution: Registering for Notifications . 198 11.8 Posting Notifications . 199 11.9 Exercise: Receiving the Custom Notifications . 201 11.10 Solution: Receiving the Custom Notifications . 201 12 Creating Protocols for Delegation 203 12.1 Exercise: Creating and Setting the Delegate . 204 12.2 Solution: Creating and Setting the Delegate .
Recommended publications
  • Cocoa Touch & Iphone
    Music Appreciation 243: Introduction to Rick Astley Evan Doll [email protected] Alan Cannistraro [email protected] Thursday, April 2, 2009 Thursday, April 2, 2009 Welcome to CS193P: iPhone Application Development Evan Doll [email protected] Alan Cannistraro [email protected] Thursday, April 2, 2009 Staff • Lecturers ■ Evan Doll [email protected] ■ Alan Cannistraro [email protected] • Student TAs ■ Troy Brant [email protected] ■ Paul Salzman [email protected] • “Professor Emeritus” ■ Paul Marcos [email protected] Thursday, April 2, 2009 How many of you... • Are familiar with object-oriented programming? • Have developed software with Mac OS X? • Have developed apps for the iPhone? Thursday, April 2, 2009 Lectures, Sections, Office Hours • Lectures ■ 320-105, Monday & Wednesday 3:15 – 4:30 PM • Optional Section ■ 200-205, Friday 3:15 – 4:05 PM as announced ■ Guest speakers, additional topics ■ First one will be next Friday 4/10 • Office Hours ■ Troy and Paul will be holding office hours ■ Time & location TBD, check website for details Thursday, April 2, 2009 Requirements • Prerequisite: CS 106B/X • Recommended Book: None, we’ll use Apple documentation • You must have access to an Intel-based Macintosh ■ Running Mac OS X 10.5 Leopard ■ iPhone SDK (Not available on cluster computers!) • Owning an iPhone or iPod Touch is not required ■ Assignments may be done with the iPhone Simulator ■ Loaner iPod Touches should be available, more details to come Thursday, April 2, 2009 Enrollment • Response has been phenomenal again
    [Show full text]
  • 706 What's New in Security 07 FINAL.Key
    System Frameworks #WWDC16 What’s New in Security Session 706 Lucia Ballard Secure Transports Engineering Manager Simon Cooper Trusted Execution Engineering Manager © 2016 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. What’s New in Security? What’s New in Security? Network Security What’s New in Security? Network Security Cryptography APIs What’s New in Security? Network Security Cryptography APIs Platform Security on macOS What’s New in Network Security Lucia Ballard Secure Transports Engineering Manager Secure Communications Secure Communications HTTPS is the new HTTP • Confidentiality • Data integrity Secure Communications HTTPS is the new HTTP • Confidentiality • Data integrity Not all HTTPS is created equal App Transport Security Current standards App Transport Security Current standards For NSURLSession and NSURLConnection APIs App Transport Security Current standards For NSURLSession and NSURLConnection APIs • TLS v1.2 App Transport Security Current standards For NSURLSession and NSURLConnection APIs • TLS v1.2 • Strong crypto—AES-128 and SHA-2 App Transport Security Current standards For NSURLSession and NSURLConnection APIs • TLS v1.2 • Strong crypto—AES-128 and SHA-2 • Forward secrecy—ECDHE App Transport Security Current standards For NSURLSession and NSURLConnection APIs • TLS v1.2 • Strong crypto—AES-128 and SHA-2 • Forward secrecy—ECDHE Exceptions—global or for particular domains App Transport Security Enforcement App Transport Security Enforcement Enforced
    [Show full text]
  • Programming Java for OS X
    Programming Java for OS X hat’s so different about Java on a Mac? Pure Java applica- tions run on any operating system that supports Java. W Popular Java tools run on OS X. From the developer’s point of view, Java is Java, no matter where it runs. Users do not agree. To an OS X user, pure Java applications that ignore the feel and features of OS X are less desirable, meaning the customers will take their money elsewhere. Fewer sales translates into unhappy managers and all the awkwardness that follows. In this book, I show how to build GUIs that feel and behave like OS X users expect them to behave. I explain development tools and libraries found on the Mac. I explore bundling of Java applications for deployment on OS X. I also discuss interfacing Java with other languages commonly used on the Mac. This chapter is about the background and basics of Java develop- ment on OS X. I explain the history of Java development. I show you around Apple’s developer Web site. Finally, I go over the IDEs commonly used for Java development on the Mac. In This Chapter Reviewing Apple Java History Exploring the history of Apple embraced Java technologies long before the first version of Java on Apple computers OS X graced a blue and white Mac tower. Refugees from the old Installing developer tan Macs of the 1990s may vaguely remember using what was tools on OS X called the MRJ when their PC counterparts were busy using JVMs. Looking at the MRJ stands for Mac OS Runtime for Java.
    [Show full text]
  • Intelligent OS X Malware Threat Detection with Code Inspection
    This is a repository copy of Intelligent OS X malware threat detection with code inspection. White Rose Research Online URL for this paper: http://eprints.whiterose.ac.uk/128371/ Version: Published Version Article: Pajouh, H.H., Dehghantanha, A. orcid.org/0000-0002-9294-7554, Khayami, R. et al. (1 more author) (2018) Intelligent OS X malware threat detection with code inspection. Journal of Computer Virology and Hacking Techniques, 14 (3). pp. 213-223. ISSN 2274-2042 https://doi.org/10.1007/s11416-017-0307-5 Reuse This article is distributed under the terms of the Creative Commons Attribution (CC BY) licence. This licence allows you to distribute, remix, tweak, and build upon the work, even commercially, as long as you credit the authors for the original work. More information and the full terms of the licence here: https://creativecommons.org/licenses/ Takedown If you consider content in White Rose Research Online to be in breach of UK law, please notify us by emailing [email protected] including the URL of the record and the reason for the withdrawal request. [email protected] https://eprints.whiterose.ac.uk/ J Comput Virol Hack Tech DOI 10.1007/s11416-017-0307-5 ORIGINAL PAPER Intelligent OS X malware threat detection with code inspection Hamed Haddad Pajouh1 · Ali Dehghantanha2 · Raouf Khayami1 · Kim-Kwang Raymond Choo3,4 Received: 31 July 2017 / Accepted: 27 September 2017 © The Author(s) 2017. This article is an open access publication Abstract With the increasing market share of Mac OS X over 91% detection accuracy with 3.9% false alarm rate.
    [Show full text]
  • Chapter 1. Origins of Mac OS X
    1 Chapter 1. Origins of Mac OS X "Most ideas come from previous ideas." Alan Curtis Kay The Mac OS X operating system represents a rather successful coming together of paradigms, ideologies, and technologies that have often resisted each other in the past. A good example is the cordial relationship that exists between the command-line and graphical interfaces in Mac OS X. The system is a result of the trials and tribulations of Apple and NeXT, as well as their user and developer communities. Mac OS X exemplifies how a capable system can result from the direct or indirect efforts of corporations, academic and research communities, the Open Source and Free Software movements, and, of course, individuals. Apple has been around since 1976, and many accounts of its history have been told. If the story of Apple as a company is fascinating, so is the technical history of Apple's operating systems. In this chapter,[1] we will trace the history of Mac OS X, discussing several technologies whose confluence eventually led to the modern-day Apple operating system. [1] This book's accompanying web site (www.osxbook.com) provides a more detailed technical history of all of Apple's operating systems. 1 2 2 1 1.1. Apple's Quest for the[2] Operating System [2] Whereas the word "the" is used here to designate prominence and desirability, it is an interesting coincidence that "THE" was the name of a multiprogramming system described by Edsger W. Dijkstra in a 1968 paper. It was March 1988. The Macintosh had been around for four years.
    [Show full text]
  • Webobjects Bundle Reference
    WebObjects Bundle Reference 2006-10-03 Times is a registered trademark of Apple Computer, Inc. Heidelberger Druckmaschinen AG, © 2006 Apple Computer, Inc. available from Linotype Library GmbH. All rights reserved. Simultaneously published in the United States and Canada. No part of this publication may be Even though Apple has reviewed this document, reproduced, stored in a retrieval system, or APPLE MAKES NO WARRANTY OR transmitted, in any form or by any means, REPRESENTATION, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THIS mechanical, electronic, photocopying, DOCUMENT, ITS QUALITY, ACCURACY, recording, or otherwise, without prior MERCHANTABILITY, OR FITNESS FOR A written permission of Apple Computer, Inc., PARTICULAR PURPOSE. AS A RESULT, THIS DOCUMENT IS PROVIDED “AS IS,” AND with the following exceptions: Any person YOU, THE READER, ARE ASSUMING THE is hereby authorized to store documentation ENTIRE RISK AS TO ITS QUALITY AND ACCURACY. on a single computer for personal use only IN NO EVENT WILL APPLE BE LIABLE FOR and to print copies of documentation for DIRECT, INDIRECT, SPECIAL, INCIDENTAL, personal use provided that the OR CONSEQUENTIAL DAMAGES documentation contains Apple’s copyright RESULTING FROM ANY DEFECT OR INACCURACY IN THIS DOCUMENT, even if notice. advised of the possibility of such damages. The Apple logo is a trademark of Apple THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND IN Computer, Inc. LIEU OF ALL OTHERS, ORAL OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer, agent, Use of the “keyboard” Apple logo or employee is authorized to make any (Option-Shift-K) for commercial purposes modification, extension, or addition to this without the prior written consent of Apple warranty.
    [Show full text]
  • Mac OS X: an Introduction for Support Providers
    Mac OS X: An Introduction for Support Providers Course Information Purpose of Course Mac OS X is the next-generation Macintosh operating system, utilizing a highly robust UNIX core with a brand new simplified user experience. It is the first successful attempt to provide a fully-functional graphical user experience in such an implementation without requiring the user to know or understand UNIX. This course is designed to provide a theoretical foundation for support providers seeking to provide user support for Mac OS X. It assumes the student has performed this role for Mac OS 9, and seeks to ground the student in Mac OS X using Mac OS 9 terms and concepts. Author: Robert Dorsett, manager, AppleCare Product Training & Readiness. Module Length: 2 hours Audience: Phone support, Apple Solutions Experts, Service Providers. Prerequisites: Experience supporting Mac OS 9 Course map: Operating Systems 101 Mac OS 9 and Cooperative Multitasking Mac OS X: Pre-emptive Multitasking and Protected Memory. Mac OS X: Symmetric Multiprocessing Components of Mac OS X The Layered Approach Darwin Core Services Graphics Services Application Environments Aqua Useful Mac OS X Jargon Bundles Frameworks Umbrella Frameworks Mac OS X Installation Initialization Options Installation Options Version 1.0 Copyright © 2001 by Apple Computer, Inc. All Rights Reserved. 1 Startup Keys Mac OS X Setup Assistant Mac OS 9 and Classic Standard Directory Names Quick Answers: Where do my __________ go? More Directory Names A Word on Paths Security UNIX and security Multiple user implementation Root Old Stuff in New Terms INITs in Mac OS X Fonts FKEYs Printing from Mac OS X Disk First Aid and Drive Setup Startup Items Mac OS 9 Control Panels and Functionality mapped to Mac OS X New Stuff to Check Out Review Questions Review Answers Further Reading Change history: 3/19/01: Removed comment about UFS volumes not being selectable by Startup Disk.
    [Show full text]
  • Introduction to Xgrid: Cluster Computing for Everyone
    Introduction to Xgrid: Cluster Computing for Everyone Barbara J. Breen1, John F. Lindner2 1Department of Physics, University of Portland, Portland, Oregon 97203 2Department of Physics, The College of Wooster, Wooster, Ohio 44691 (First posted 4 January 2007; last revised 24 July 2007) Xgrid is the first distributed computing architecture built into a desktop operating system. It allows you to run a single job across multiple computers at once. All you need is at least one Macintosh computer running Mac OS X v10.4 or later. (Mac OS X Server is not required.) We provide explicit instructions and example code to get you started, including examples of how to distribute your computing jobs, even if your initial cluster consists of just two old laptops in your basement. 1. INTRODUCTION Apple’s Xgrid technology enables you to readily convert any ad hoc collection of Macintosh computers into a low-cost supercomputing cluster. Xgrid functionality is integrated into every copy of Mac OS X v10.4. For more information, visit http://www.apple.com/macosx/features/xgrid/. In this article, we show how to unlock this functionality. In Section 2, we guide you through setting up the cluster. In Section 3, we illustrate two simple ways to distribute jobs across the cluster: shell scripts and batch files. We don’t assume you know what shell scripts, batch files, or C/C++ programs are (although you will need to learn). Instead, we supply explicit, practical examples. 2. SETTING UP THE CLUSTER In a typical cluster of three or more computers (or processors), a client computer requests a job from the controller computer, which assigns an agent computer to perform it.
    [Show full text]
  • How to Disable Gatekeeper and Allow Apps from Anywhere in Macos Sierra
    How to Disable Gatekeeper and Allow Apps From Anywhere in macOS Sierra Gatekeeper, first introduced in OS X Mountain Lion, is a Mac security feature which prevents the user from launching potentially harmful applications. In macOS Sierra, however, Apple made some important changes to Gatekeeper that seemingly limit the choices of power users. But don’t worry, Gatekeeper can still be disabled in Sierra. Here’s how. Stand out at the party or promote your business with colorful powder coated and custom engraved Yeti tumblers from Perfect Etch. Traditionally, Gatekeeper offered three settings of increasing security: anywhere, App Store and identified developers, and App Store only. The first choice, as its name describes, allowed users to launch applications from any source, effectively disabling the Gatekeeper feature. The second choice allowed users to run apps from the Mac App Store as well as from software developers who have registered with Apple and securely sign their applications. Finally, the most secure setting limited users to running apps obtained from the Mac App Store only. While the secure options were good ideas for less experienced Mac users, power users found Gatekeeper to be too limiting and typically sought to disable it by setting it to “Anywhere.” In macOS Sierra, however, the “Anywhere” option is gone, leaving “App Store” and “App Store and identified developers” as the only two options. Disable Gatekeeper in macOS Sierra The Gatekeeper settings can be found in System Preferences > Security & Privacy > General. The Gatekeeper options are located beneath “All apps downloaded from:” with the choice of “Anywhere” missing. Thankfully, the “Anywhere” setting can be restored to Gatekeeper in Sierra with a Terminal command.
    [Show full text]
  • Video Capture 3-In-1 Video Capture
    Model: NV100C Video Capture 3-in-1 video capture Quick Start Guide 1 Table of Contents Overview ........................................................................................... 3 Package Contents ................................................................................................. 3 System Requirements ........................................................................................... 3 Use on Mac OS .................................................................................. 4 Hardware Installation ........................................................................................... 4 Driver Installation ................................................................................................. 4 Capture Video on QuickTime Player ..................................................................... 4 Use on Windows PC/Laptop ............................................................... 7 Hardware Installation ........................................................................................... 7 Driver Installation ................................................................................................. 7 Capture Video on CyberLink PowerDirector ......................................................... 7 Capture Video on VivaStation............................................................................. 10 Use on Android Device .................................................................... 12 Capture Video on VivaCAP ................................................................................
    [Show full text]
  • Using the Java Bridge
    Using the Java Bridge In the worlds of Mac OS X, Yellow Box for Windows, and WebObjects programming, there are two languages in common use: Java and Objective-C. This document describes the Java bridge, a technology from Apple that makes communication between these two languages possible. The first section, ÒIntroduction,Ó gives a brief overview of the bridgeÕs capabilities. For a technical overview of the bridge, see ÒHow the Bridge WorksÓ (page 2). To learn how to expose your Objective-C code to Java, see ÒWrapping Objective-C FrameworksÓ (page 9). If you want to write Java code that references Objective-C classes, see ÒUsing Java-Wrapped Objective-C ClassesÓ (page 6). If you are writing Objective-C code that references Java classes, read ÒUsing Java from Objective-CÓ (page 5). Introduction The original OpenStep system developed by NeXT Software contained a number of object-oriented frameworks written in the Objective-C language. Most developers who used these frameworks wrote their code in Objective-C. In recent years, the number of developers writing Java code has increased dramatically. For the benefit of these programmers, Apple Computer has provided Java APIs for these frameworks: Foundation Kit, AppKit, WebObjects, and Enterprise Objects. They were made possible by using techniques described later in Introduction 1 Using the Java Bridge this document. You can use these same techniques to expose your own Objective-C frameworks to Java code. Java and Objective-C are both object-oriented languages, and they have enough similarities that communication between the two is possible. However, there are some differences between the two languages that you need to be aware of in order to use the bridge effectively.
    [Show full text]
  • When You Can't Be There in Person
    When You Can’t Be There in Person Virtual visitation can open a door into your child’s world BY CHRISTINA S. GLENN & DENISE HALLMARK eparation and divorce will change a parent’s lifestyle in a multitude of ways, but most profoundly, in the amount of time spent with children. With so many divorces in the United States and so many couples deciding to have children, S Published in Family Advocate, Vol. 38, No. 1, but not to marry, more and more children will live apart from at least one parent, (Summer 2015) p. 19-21. © 2015 by the more commonly the father, at some point in their lives. The growth in the number of American Bar Association. Reproduced with permission. All rights reserved. This information noncustodial fathers (that is, the parent who lives apart from the children) has been or any portion thereof may not be copied or disseminated in any form or by any means or accompanied by concerns that a father’s absence can have severe and long-lasting stored in an electronic database or retrieval consequences for a child’s well-being. A noncustodial parent’s access can be even system without the express written consent of the American Bar Association. more problematic when the child lives far away. The good news is that modern technology, in the form of virtual parenting time, offers at least a partial solution to the problem of long-distance parenting. Virtual parenting time allows a parent to stay connected with his or her children electronically through e-mail, instant messaging, texting, phone calls, and video conferencing.
    [Show full text]