Objective-C Programming Class

This class covers the Objective-C Programming language, the programming language essential for creating applications on the iPhone, iPad, and Mac environments.

Lecture 3 - Foundation Classes, drawing to the screen, delegation introduction

In this lecture, Foundation classes were covered in more detail. Design patterns that assist communication between objects were briefly discussed, including: delegation, notification, target/action and KVO (Key Value Observing). The delegate design pattern was demonstrated through implementation of a basic UITableView object.

This link to the Cocoa Fundamentals Guide at developer.apple.com is largely targeted to the Mac platform. It is a nice overview of the communication mechanisms found in Cocoa:

Homework 3: Investigating delegation and the UITableView

The purpose of this homework assignment is to gain more practice working with Objective-C and the Foundation classes. Additionally, it will help you to become more familiar with delegation and the UITableView class. Hopefully you will have fun with the assignment and will experiment outside of the homework requirements, for example by adding a custom view to the UITableviewCell or by changing the appearance of the cell. This one could take up some time as some of the concepts may be unfamiliar.

Create an iPhone or iPad application using either the window-based or the view-based template. Add a UITableView to the screen that displays data you have stored in an NSArray. After you get it working, use the appropriate delegate method to change the height of each UITableViewCell to be 100 points. This assignment will take some time, but will be a foundation for many iphone projects. See Day3.zip for a good example of the elements required.

Lecture 2 - iPhone/iPad Objective-C and Foundation Classes

In this lecture, we continued to look at the Objective-C language and some Foundation classes like NSString and NSArray.

The path of execution of an iOS app was followed from main.m to UIApplicationMain() to info.plist to MainWindow.xib to the delegate and finally to the AppDelegate class and the didFinishLoading method. See the s.zip project below for the project that was created during Class. The project was named with a small name so that it would display more nicely on the overhead and to make the Classes created by the template more clear.

Many of the concepts from lecture 2 are revisited in the video covering the Homework 2 solution below.
http://s3.amazonaws.com/certifiednetworks/video/iphone-sdk/Homework2-ucla-201110b.mp4 1024x768 30MB 10:58

Homework 2: Using a custom class
Create an iPhone or iPad application using the view-based template. Display information from a custom class onto an instance of UILabel. See HW2b.zip below for one possible solution.

Lecture 1 - Objective-C Environment and Basics

In this lecture, the iOS Platform was introduced using the iPad and iPhone. The Objective-C language and its basic elements was introduced.

Objective-C is an extension of the ANSI C language which has been extended to include certain features centered around object oriented programming.
The following Objective-C extensions were discussed and should be reviewed: @interface, @class, @property, [] (square brackets), #import, - (minus sign to mark an instance method), + (plus sign to mark an instance method).

Homework 1: Getting Started
Send me an email. Read 'Learning Objective-C: A Primer' Listed below. Install the iOS SDK and XCode.
Create an iphone application using the view-based template. Display "Hello, World." on an instance of UILabel.

Apple Documentation - Objective-C, A Primer. http://developer.apple.com/iphone/library/referencelibrary/GettingStarted/Learning_Objective-C_A_Primer/

XCode Projects - Class Demos, Examples and Homework Answers


13.0MB, 05:35, 7/10/2011 - Demonstrates creating a universal app that displays two views. Walkthrough for the answer to homework 3.


Class Logistics

External Links

Apple.com Developer - Information about development on Apple platforms
Gnustep.org - cross platform open source Cocoa environment for Linux and Windows.
home Site Map Terms of Use Privacy Policy Client Directories