IT110 – Intro to iPhone Application Programming

multuni_iphone_logo

Interested in developing applications for the world’s hottest smartphone?  Want to expand your job possibilities?  Ready to become an entrepreneur in the mobile industry?

Course Description

This course will teach you how to write iPhone applications using Objective-C and the Cocoa Touch framework. The goal is to get you through the learning curve of iPhone development: to give you the confidence and knowledge you need to jump into the mobile industry.Xcode_icon

Topics we will cover include:

  • Objective-C
  • Xcode and debugging
  • Cocoa Touch View and Controller classes
  • Interface Builder and application flow
  • Fetching and storing data: disk, database, and web services

This course is based on materials from the MIT IAP 2009 course.

Schedule & Materials

Notable questions from students

  • What’s the difference between declaring a variableidand NSObject *?
    • From StackOverflow: With a variable typed id, you can send it any known message and the compiler will not complain. With a variable typed NSObject *, you can only send it messages declared by NSObject (not methods of any subclass) or else it will generate a warning. In general, id is what you want.
  • Does every class have to inherit fromNSObject *?
    • From AppleNSObject is the root class of most Objective-C class hierarchies. Through NSObject, objects inherit a basic interface to the runtime system and the ability to behave as Objective-C objects. For example, you can ask a NSObject subclass or instance thereof if it responds to a message before invoking a particular method.
    • From StackOverflow: There are a few that don’t, like NSProxy and the Objective-C classes (Protocol, Class). It is possible to write your own Objective-C classes that do not have a root object, but it involves calling the Objective-C runtime functions directly in order to properly allocate instances and register bits and pieces, which is not easy to do.
  • Does releasing an object automatically set it to nil?
    • No, the object pointer still references an old memory address.  Some people recommend you immediately set the pointer to nil so that if by accident you pass a message to that object, your program won’t crash and it will simply do nothing (it’s a no-op).  The reason, in Objective-C passing a message to nil is ignored, unlike calling a method on a NULL pointer for example.  But Huy’s personal opinion is it’s a bad idea to allow sending messages to nil anyway because you’re allowing the program to do something unexpected and you won’t know if you have a bug until very much later.
  • Can you define class variables?
    • From Apple: No, you should define an external variable of some sort.  You can declare a variable in the class implementation file.
      int MCLSGlobalVariable;
      @implementation MyClass
      // implementation continues

      Or you can declare a variable as static and provide class methods to manage it. This limits its scope to that implementation file, so static variables cannot be inherited or manipulated by subclasses.

      static MyClass *MCLSSharedInstance;
      @implementation MyClass
      + (MyClass *)sharedInstance
      {
          // check for existence of shared instance
          // create if necessary
          return MCLSSharedInstance;
      }
      // implementation continues
    • To initialize class variables, read the documentation about Initialize a Class Object
  • What is the difference between UIWindow and UIView?
    • From Apple: The UIWindow class defines objects (known as windows) that manage and coordinate the windows an application displays on the screen. The two principal functions of a window are to provide an area for displaying its views and to distribute events to the views. The window is the root view in the view hierarchy. A window belongs to a level; the windows in one level appear above another level. For example, alerts appear above normal windows. Typically, there is only one window in an iPhone OS application.

Logistics

How?

This course is organized as a series of lectures and live coding sessions.  Students are encouraged but not required to follow along on their computers during class and at home.  A grade for this class is optional and will be given if the student submits an assignment.  Classes will be mostly in English with teaching assistants available to translate and answer student questions in Vietnamese.

When?

Friday October 9 – Monday October 19, 2009
6:30PM – 8:30 PM

Where?

FPT-Aptech (sponsor for this course, but not affiliated with MultiUni)
46 Nguyen Van Thu, Q1, TP.HCM

Who’s teaching?

Huy Zing — studied at Caltech, worked at Oracle, taught at RMIT, Founder & CTO of MultiNC
with the assistance of native speakers
Khang Nguyen & Hoàng Xuân Phú — students at RMIT, iPhone developers at MultiNC

How much?

Free

How to register?

» Apply here → Registration is closed

How you can help


Sponsors for this course

(Sponsors are not affiliated with MultiUni which is an independent community-run organization)

FPT-Aptech logo