Objective-C is the programming language for writing native iPhone and Mac applications. It’s also the language that Apple uses to build their own applications and frameworks. So, if you know Objective-C, you have a lot of power at your fingertips. But if you’re new to C or object-oriented programming, then Objective-C can seem a little awkward at first. These screencasts by Bill Dudney, an experienced Objective-C programmer, will help you quickly get up to speed on Objective-C 2.0 basics.
Coding in Objective-C 2.0
by Bill Dudney
About this Title
Available in: DRM-free Theora Ogg, iPod/iPhone 3 Video, iPad/iPhone 4 Video, and Quicktime Video
Download and watch when and where you want
After watching these video tutorials, you’ll be more confident to start writing high-quality iPhone and Mac applications. You’ll not just know how to write code, you’ll also understand why it works. You’ll feel more comfortable with the Objective-C syntax and object-oriented programming in general. You’ll also be able to manage memory wisely and diagnose common memory problems. You’ll have added yet another programming language to your toolbox, and your resume!
Watch a free sampler movie of this screencast series.
(4 min, QuickTime | iPhone/iPod | Ogg)
- If you need a jump start using Xcode (the IDE used for Mac OS X programming), have a look at Mike Clark’s two-part screencast series.
Read the reviews .
Contents & Extracts
In addition to the videos, you can also download the source code for each episode so you can follow along and experiment on your own.
Episode 1: Classes, Objects, and Messages (59 minutes)
In this episode, we’ll write a small program in Xcode to learn the basics of object-oriented programming with Objective-C. You’ll learn how to:
- Write, build, and run basic Objective-C code in Xcode
- Use the Objective-C extensions to C for object-oriented programming
- Understand basic object-oriented programming concepts
- Use existing classes
- Write your own custom classes
- Define instance variables
- Use Objective-C 2.0 properties
- Define and implement methods
- Instantiate objects
- Send messages to objects
- Override superclass behavior
- Write custom initializers
Episode 2: Memory Management (41 minutes)
Objective-C 2.0 has a garbage collector, but it’s not available on the iPhone. So if you’re writing iPhone applications, you’ll need to manage your own memory. And it’s especially important on the iPhone, where resources are constrained, that you clean up after yourself. In this episode, we’ll find and fix various memory-management problems that are common in Objective-C programs. You’ll learn how to:
- Manage memory wisely using
- Apply object ownership rules
- Understand how reference counting works
- Track down over-release problems
- Use Instruments to find and fix memory leaks
- Clean up an object’s state in the
- Release and retain instance variables in setter methods
- Use properties to ensure consistent memory management
- When and how to
autoreleaseobjects using autorelease pools
- Manage memory wisely using
Episode 3: Debugging (42 minutes)
Bugs happen, even in Objective-C programs. You’ll want to find and fix them as quickly as possible. Thankfully, Xcode has a powerful debugger. In this episode, we’ll explore the various features and commands of the debugger, use it to find a bug, and wrap up with remote debugging. You’ll learn how to:
- Use the debugger to find and squash bugs
- Set breakpoints, and disable them for quicker debug cycles
- Navigate your program with debugger controls
- Inspect and change program state on the fly
- Edit breakpoints to conditionally stop or run arbitrary actions
- Use common GDB commands for more convenient debugging
- Debug an iPhone or iPod Touch application remotely
- Other expert debugging tips and tricks!
At some point in the future (we don’t know exactly when), we’re planning to record and release a few more episodes on topics including:
- Unit testing
- Categories and protocols
- Dynamic programming
If you’ve purchased an episode in this series, and your account is configured to receive e-mail announcements from us, we’ll send you an e-mail when new episodes are released.
These screencasts are ideal for programmers who are new to object-oriented programming and Objective-C. No prior experience with C is required.
Bill Dudney is a software developer and entrepreneur currently building software for the Mac. He’s also the author of iPhone SDK Development and Core Animation for OS X and the iPhone. Bill started his computing career on a NeXT cube with a magneto-optical drive running NeXTStep 0.9. He created several iPhone applications currently selling on the App Store. You can follow him on his blog.