Objective-C Programming
This online course
covers the Objective-C Programming language.
Objective-C is the fundamental programming language essential for creating applications
for iOS on the iPhone, iPad, and MAC platforms.
Dave Henson is the instructor for the course. Please feel free to contact him by email at
dhenson@certifiednetworks.com if you have any comments or questions.
Login
Enter your login information to access the full content of this site. Access is restricted to registered students.
Section 4 - Conditional Logic
Conditional logic is used within your application to make decisions during the application lifetime.
Objective-C is quite typical of other languages in the syntax and structure of conditional logic, though things get more complicated
when attempting to determine if two NSObject-based objects are equal. The main syntax elements you have available are the if statement,
the switch statement, and the question mark ? known as the ternary operator in the C programming language.
In this video conditional logic is explored in Objective-C in both a console application, and
in the context of an iphone application.
http://git.certifiednetworks.com/videos/ObjectiveC/objectivec-section4.mp4 1920x1080 162.3MB 24:24
Homework 4: Conditional Logic
Create a new project in XCode using the Mac OS X/Command
Line Tool template.
use at least one case of each of the following:
if statement using the == operator
if statement using the isEqualTo: method
compound logic, using and (&&) or using or(||)
Perform a logical test to see if something is not true.
Section 3 - Methods and Parameters
Methods are functions that are defined on a class in order for that class to perform tasks. Often, those tasks involve ivars and properties of the object, and
sometimes those tasks require extra information to complete the task properly. This extra information can be passed to the
method through parameters.
In this video Objective-C methods and parameters are discussed. Various methods are demonstrated both in a console application, and
in the context of an iphone application.
http://git.certifiednetworks.com/videos/ObjectiveC/objectivec-methods-full.mp4 1920x1080 62.3MB 19:34
Homework 3: Methods and parameters
Create a new project in XCode using the Mac OS X/Command
Line Tool template.
Create a custom class that contains at least three public methods and one private method.
From the main() method in main.m, create an instance of the class and demonstrate calling the methods.
Section 2 - Variables and Properties
Homework 2: Working with variables and properties
Create a new project in XCode using the Mac OS X/Command
Line Tool template.
Create a custom class that contains at least two ivars and two properties. Make the custom class
represent something that is fun or meaningful to you.
From main.m, create an instance of the class. Set the contents of the ivar using the
dot syntax. Retrieve the contents of the ivar using the dot syntax, and print the contents to the console.
At the Apple developer site, track down the official Objective-C documentation. Review the section on properties.
The Objective-C Programming Language
Section 1 - Getting Started with Objective-C
Homework 1: Getting Started with XCode and Objective-C
The purpose of this homework assignment is to gain experience working with Objective-C.
Download and install the latest version of XCode. Create a new project in XCode using the Mac OS X/Command
Line Tool template. Create a custom class. Call a method on an instance of your custom class to print
"hello world" to the console.
Navigate to the Apple developer site, and read the Objective-C Primer. This is approximately 8 pages, and
gives a really nice review of the extensions you will find in Objective-C.
Apple Documentation - Objective-C, A Primer.
http://developer.apple.com/iphone/library/referencelibrary/GettingStarted/Learning_Objective-C_A_Primer/
Welcome
XCode Projects - Class Demos, Examples and Homework Answers
Slides
Course Logistics
Previous Sections of This Course
External Links
Apple.com Developer - Information about development on Apple platforms
Gnustep.org - cross platform open source Cocoa environment for Linux and Windows.
Why Learning Objective-C is Hard - Interesting perspective from a blogger.