Learn Objective-C in 24 Days
Yep, that title says 24 DAYS, not hours. You can’t learn a programming language in 24 hours. Publishers say you can, but that’s just for marketing purposes.
To really learn a language — to the point where you don’t have to look back through a book every other line — takes time.
It takes time to do the exercises. It takes time to formulate questions, and answer them for yourself (although I’ll be glad to answer any to the best of my ability). It takes time to let the language sink in.
I’m starting a series that will attempt to teach the Objective-C language. As Stephen Kochan did in his book, I will attempt to teach plain C and Obj-C as one language. I don’t know how long it’ll take to complete — we’ll see.
I want to do a solid job of teaching the language though. This post will be updated as an index of all the lessons. I hope to have the first one out by the end of the week.
My goal is to teach the series at a comfortable pace for most people. I want it to be a fun and engaging experience, and an easy place for beginners to begin their coding journey. As always, comments and criticisms are appreciated.
Download a copy of Xcode, and get ready to learn!
Here are my goals for the course:
- As I mentioned before, I will attempt to teach C and Objective-C as one language. Obj-C is a strict superset of plain C, which means that any valid C is also valid Obj-C. The reason for this decision is that C is a procedural language, where you worry about how you do a task, whereas Obj-C is an object-orientated language, where you worry about what you use to do a task. It’s a radical shift in mindset. As a result, although Obj-C builds smoothly off of plain C, not all C styles and procedures work with Obj-C.
- I want to engage, not just present the facts. As a result, I will supply plenty of screenshots, and include exercises at the end of each lesson. I will also post the source code to each lesson on this blog.
- I want to create a solid understanding that frees you from having to go back to a reference every other line of code. That gets annoying, and you won’t get much respect in programming circles. 😛
- I want to make it an easy and fluid learning environment. People learn better when they are subject to less stress. In fact, I’m not going to stress you at all—you’ll be your own motivator. You want to build the next great iPhone app — so put in the effort! In this course, I hope to build up a small code library, and have each lesson build up off the previous.
Directory of Lessons:
- A Brief History of Objective-C
- Language Concepts
- Back to Basics: How Programming Languages Work
- Lesson 1: Hello, World!
- Lesson 2: Basic Variables
- Lesson 3: Object-Oriented Programming
- Lesson 4: if() statements and Booleans
- Extending “Hello, World!”
- Reserved Keywords
- Escape Sequences and Format Specifiers
- Integer Operations
- Floating-Point Operations
- ASCII, Booleans and Characters
- Conditional Operator
- What Goes Inside the if() Statement
- The switch Statement
- Lesson 5: Loops
- Incrementation
- Loop Aids
- Creating a New iPhone Project
- Objects (Part 1): Splitting Classes Into Multiple Files
- Objects (Part 2): Properties
- Objects (Part 3): Extending the Fraction Class
- Objects (Part 4): Inheritance — iVars & Methods
- Objects (Part 5): Inheritance — Extending & Overriding
- Objects (Part 6): Inheritance — Some Loose Ends
- Objects (Part 7): Introspection
- Objects (Part 8): Dynamic Typing
- Data Encapsulation
- Methods (In Detail)
- Pointers
- The Preprocessor
- Conditional Compilation
- Variable Scope
- Enumerated Types and typedefs
- Categories
- Protocols
- Memory Management
- Object Initialization
- Complex Initializers
- Exception Handling
- Key-Value Coding
- Advanced KVC
- Structs and Unions
- Structs and Objects
- Foreach Loop
- Mutable vs. Immutable Strings
- Floating in Uncertainty
- A Handy Debugging Tool
- Design Patterns: Model-View-Controller
- Cocoa Naming Conventions
- Design Patterns: Key-Value Observing
- Advanced Tables
- Rotation
- A Quartz Primer
- Adding Frameworks to an Xcode Project
- Building an App (Part 1): Basic UI Elements
- Building an App (Part 2): More UI Elements
- Building an App (Part 3): Flipping and Tab Bars
- Building an App (Part 4): Automatic Reference Counting
- Building an App (Part 5): Table Views and Nav Controllers
- Building an App (Part 6): Navigation Controllers and Stacks
- Building an App (Part 7): Quartz Demo 1
- Building an App (Part 8): Quartz Demo 2
- Building an App (Part 9): Quartz Demo 3
- Building an App (Part 10): Basic Data Persistence
- Building an App (Part 11): Core Data
- Building an App (Part 12): Working With Web Data
I might add a few to this list in the future – but this covers all of the basics and more. Stay tuned!
Author: Feifan Zhou