Home > 2011 Winter DPS913 > Lecture notes for Tuesday January 18

Lecture notes for Tuesday January 18

January 18, 2011 Leave a comment Go to comments

After completing the detailed introductions to Objective-C and Cocoa in the last two class sessions, we will begin creating iOS apps today. A thorough introduction to views and user interface elements is featured today. We’ll also get started with user interaction, and data type conversion for common operations.

.

Prepare for today’s class

Show up on time. Be alert and mentally agile. Be prepared to learn.

If you wish, you can look at some of the introductory readings in the DPS913 Virtual Textbook.

And, you can go through the digital content linked below.

Handouts will be distributed in class.

.

Coming up in DPS913 / APD601

Fri Jan 21 – lecture topics continued from the previous class

Tue Jan 25 – data persistence, modal view controllers

.

IB commentary

In the last class session, we introduced the Interface Builder (IB) development tool. We used it to create a very simple app that had no interaction or other functionality – it simply displayed “Hello, world!” on the screen.

At the beginning of today’s session, we continue by covering some IB highlights. Please refer to the “Apple development toolset introduction for SCS students” blog post (or handout) for details. The highlights covered today include the following:

The MVC design pattern enforces the requirement to place user interface (UI) elements in the view, which is contained in the nib file (with the .xib extension). Code that supports the user interface is placed in the controller, which is the <appname>ViewController file pair (.h and .m).

The key concepts that enables you to “connect” view and view controller objects together are outlets and actions.

An outlet is an instance variable that refers to another object. Another way of saying this is that (frequently) an outlet is (typically) a reference to a user interface object. Here’s how you create an outlet: In your view controller code (using XCode), you declare a property, and designate it to be an outlet. In your view (using IB), you connect a user interface element to the outlet.

The IBOutlet type qualifier (macro) is used to designate an outlet in your view controller code. The IBOutlet type qualifier appears before the type name in the property declaration.

An action is a message-passing relationship between a user interface control (which is a user interface element that supports the generation of events) and a designated “action” method that’s typically located in a view controller. The method is located in a “target”, so this concept is often referred to as “target/action”.

The IBAction type qualifier (macro) is used as the method’s return type when the method is declared.

We’ll see all of these highlights in action today, in the notes, and in the code examples.

.

Topic coverage in today’s lecture

Building a simple iOS app
Also, refer to the “Introductory Guidelines for Writing Your Own Classes” document

Properties in Objective-C

iOS app structure and startup
Also, refer to the “Events 1” example app
Also, study the “New iOS View-based Application (iPhone and iPod touch)” document (handout in class)

Views, view controllers, and user interface elements

Get started with data conversions and keyboard handling

An introduction to DPS913 APD601 Lab 1

.


Advertisements
Categories: 2011 Winter DPS913
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: