Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Objective-C Programming Nuts and bolts
Objective-C Programming Nuts and bolts
Objective-C Programming Nuts and bolts
Ebook185 pages1 hour

Objective-C Programming Nuts and bolts

Rating: 0 out of 5 stars

()

Read preview

About this ebook

Objective-C Programming Nuts and bolts provides a clear and concise overview of the programming language, describes its key features and APIs, and presents recommendations for developing iOS and OS X apps using Objective-C. It is written for readers who want a general understanding of Apple Objective-C technology on the Mac along with developers who want to quickly get started with the language. Very quickly, you will have a solid understanding of Objective-C and be ready to begin using it on your projects!
The book includes a complete overview of the latest enhancements to the Objective-C language, including generics, nullability annotations, and other features. The book is divided into two parts; Part One provides an introduction to object-oriented programming with Objective-C, describes the software development environment for the iOS and OS X platforms, and summarizes key features of the language. Part Two is more focused on application development - it features an in-depth look at the principal components of Objective-C programs, along with a detailed review of the key frameworks and services used for Objective-C application development. The book concludes with a summary and a list of useful references for programming with Objective-C.

LanguageEnglish
PublisherKeith Lee
Release dateSep 28, 2015
ISBN9781495176401
Objective-C Programming Nuts and bolts
Author

Keith Lee

Keith Lee is a noted composer, author, and technologist. He has composed numerous works for both soloists and diverse ensembles. He also has over 20 years of experience designing and implementing information systems.

Read more from Keith Lee

Related to Objective-C Programming Nuts and bolts

Related ebooks

Programming For You

View More

Related articles

Reviews for Objective-C Programming Nuts and bolts

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Objective-C Programming Nuts and bolts - Keith Lee

    Objective-C Programming Nuts and Bolts

    By Keith Lee

    Copyright 2015 Keith Lee

    Smashwords Edition

    Discover other titles by Keith Lee at Smashwords.com:

    iOS Programming Nuts and Bolts

    Swift Programming Nuts and Bolts

    Programming for Everyone

    The Composer-Performer Relationship in Contemporary Music

    Smashwords Edition, License Notes

    This eBook is licensed for your personal enjoyment only. This eBook may not be re-sold or given away to other people. If you would like to share this book with another person, please purchase an additional copy for each recipient. If you’re reading this book and did not purchase it, or it was not purchased for your use only, then please return to Smashwords.com and purchase your own copy. Thank you for respecting the hard work of this author.

    Objective-C Programming Nuts and Bolts

    Motu Presse Publications

    No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the author and publisher assume no responsibility for errors or omissions. Nor is any liability assumed for damages resulting from the use of the information contained herein.

    ISBN (electronic): 978-1-4951-7640-1

    Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied. The information provided is on an as is basis. The author and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book.

    The source code for examples that accompany this book, as well as other resources, is available at www.motupresse.com.

    Table of Contents

    Preface

    Introduction

    Chapter 1: Getting Started

    Programming Language

    Development Environment

    Developer Tools

    Your First Objective-C Program

    Chapter 2: Key Features

    Object Messaging

    Encapsulation

    Polymorphism

    Inheritance

    Dynamic Runtime

    Memory Management

    Chapter 3: Application Structure

    Preprocessor Elements

    Variables

    The Class Section

    Properties

    Methods

    The Main Section

    C Language Elements

    Chapter 4: Basic Elements

    Variables

    Comments

    Other Types

    Operators

    Expressions and Statements

    Chapter 5: Objective-C Literals

    NSNumber Literals

    Container Literals

    Expression Literals

    Object Subscripting

    Chapter 6: Blocks

    Syntax

    Usage

    Block Objects

    Chapter 7: Generics

    Syntax

    Usage

    Chapter 8: Additional Topics

    Understanding Variable Scope

    Using NULL, nil, and NSNull

    String Constants versus String Literals

    MRR Memory Management

    ARC Memory Management

    Understanding Properties

    Using Categories

    Message Selectors

    Forwarding Declarations

    Handling Errors

    Concurrent Programming

    NSObject Methods

    Chapter 9: Frameworks and Services

    Cocoa and Cocoa Touch

    Foundation Framework

    Chapter 10: Resources

    Chapter 11: NeXT Steps

    About the Author

    Preface

    Objective-C Programming Nuts and Bolts provides a clear and concise overview of the programming language, describes its key features and APIs, and presents recommendations for developing iOS, watchOS, and OS X programs using Objective-C. Very quickly, the reader will have a solid understanding of Objective-C and be ready to begin using it on his/her projects.

    So, let’s begin!

    INTRODUCTION

    Objective-C is one of the standard programming languages for developing applications on Apple’s iOS, watchOS, and OS X platforms. In recent years these platforms have become some of the most popular development environments for programmers. General users and IT professionals alike want to be able to quickly grasp the fundamentals of this technology and begin using it to build solutions. This book was written to help you acquire this knowledge by answering the following questions: 1) What do you need to know to understand the Objective-C language and its role within the Apple technology ecosystem?, 2) what do you need to begin developing programs using Objective-C, and 3) how do you quickly transition to Objective-C from another programming language? Objective-C Programming Nuts and Bolts provides these answers.

    Who This Book Is For

    This book is for developers of all levels of expertise who have, at a minimum, knowledge of basic programming concepts. In addition knowledge of object-oriented programming concepts, while not necessary, is also useful.

    What You Need

    Before you begin writing Objective-C code for the Apple platforms, you’ll need an Intel-based Mac computer running OS X El Capitan (version 10.11) or later. You’ll also need Xcode 7 (or later), Apple’s toolset for software development using Objective-C.

    How to Use This Book

    This book is divided into three parts. Part One provides an introduction to object-oriented programming with Objective-C, describes the software development environment for the iOS, watchOS, and OS X platforms, and summarizes key features of the language. Part Two is more focused on application development - it features an in-depth look at the principal components of Objective-C programs, along with a detailed review of the key frameworks and services used for Objective-C application development. Part Three consists of final comments on this book along with references and recommendations that will be useful as you develop apps using Objective-C.

    Readers who want a general understanding of Objective-C technology on the Apple platforms will probably focus more on Part One of the book (Chapters 1-2). Experienced developers looking to transition to Objective-C will tend to concentrate on Part Two (Chapters 3-9).

    Typographical Conventions

    The following typographical conventions are used in this book:

    Bold font style within the body of text indicates significant words or phrases. Bold is also used to identify chapters or sections within a chapter.

    Italics font style indicates new words or phrases that are explained further in the body of the book.

    Monospaced, constant width font is used for programming code excerpts and examples.

    Monospaced, constant width bold font is used within programming code excerpts and examples to indicate key elements and concepts.

    Monospaced, constant width italic font is used within programming code excerpts to indicate comments.

    Attention New Programmers!

    Particularly for beginners, computer programming can be a little frustrating at first. Here are a few recommendations that will be very helpful when you start writing programs:

    Proper syntax - It is very important that your program code has the correct syntax. Specifically, capitalization, spacing, and other syntax elements should be identical to that shown in this book and the reference documentation. In general computers and programming languages are very strict about syntax, so if you make typing errors your program will not run properly.

    Check your work – Mistakes happen, so check your work frequently, particularly just before you run your programs.

    One step at a time – Develop your programs incrementally. This means write small portions of code, test and fix errors until you verify the code works as expected, and add more code to your program accordingly.

    GETTING STARTED

    How do you get started with a new programming language? The first steps include acquiring a basic understanding of the language and its key features, along with knowledge of the infrastructure, facilities and tools available for software development. We'll start to lay this foundation here.

    Programming Language

    Brad Cox and Tom Love created the Objective-C programming language in the early 1980s, with the primary goal of adding object-oriented extensions to the ANSI C programming language. Objective-C is actually a strict superset of C that has been extended with features to support object-oriented programming. These features (object orientation, dynamic types, and reflection) were derived from the Smalltalk programming language.

    In 1996 Apple acquired NeXT Software; the NeXTstep/OPENSTEP system served as the basis for the current Apple operating system (OS X). NeXTstep also provided built-in support for the Objective-C language.

    Over the years Apple has released many new features to Objective-C to make programming with the language faster, safer, and more efficient. Some latest updates include automatic memory management, declared and synthesized properties, fast enumeration, exception support, performance enhancements, 64-bit machine support, and support for generic programming. You will learn about these and many other features in the upcoming features.

    Enjoying the preview?
    Page 1 of 1