Stanford iPhone programming class 1st Demo – Why it fails in class

April 24, 2009 § 5 Comments

Stanford instructor asked the class to response and figure out the class demo on Slider. No one responded.

I reviewed all the comments from iphone developer forum on the Stanford iphone programming class 1st demo on Slider. Many class observers were complaining without figuring out the problems and couldn’t complete the project by following the class demo.

I gave a shot at it tonight. I solved it in 30min after experimenting a few things.

Missing:

Stanford instructor forgot to add a UIView object outlet on Interface Builder. He placed the UILabel and UISlider on UIWindow directly.

This is my comment:

I feel Stanford instructor should have considered adding 2 extra slides explaining Interface Builder and UIKit framework before the class demo. If he would have explained it, he wouldn’t have forgotten an important step on Interface Builder.

Explaination:

UIWindow has no visual features. UIView class is a based class designed to support the drawing of the objects. UIWindow is functional like a picture frame and UIView class is serving as drawing canvas.

Imagine you are about to draw a house label and door slider. Only you discover there is no canvas to draw and show the drawing. The simulator shows black because it has no canvas to draw and render the objects.

First you need to add UIView from Library to the window first before you add UILabel and UISlider.

Add a new item on Identity Inspector on Interface Builder. Example:
Outlet: view
Type: UIView

You should have 3 object types:
UILabel
UISlider
UIView

Then you can control-drag the view to connect with “view” on the “window”.

Don’t forget to select “Write Class Files” under File Menu. This step will generate .h and .m files for controller.

Wishlist: I included the Xcode project here

§ 5 Responses to Stanford iPhone programming class 1st Demo – Why it fails in class

  • stelt says:

    You know you can use SVG on the iPhone, right?
    SVG world conference is actually near Stanford this year, see http://svgopen.org

    • svwebbuilder says:

      Just check out. It is hosted by Google at Google campus. It is not exactly walking distance from Stanford campus. SVG is often under supported on the web. SVG is very useful. No one mention much on SVC on iphone SDK. Any advise?

    • svwebbuilder says:

      SVG, which stands for Scalable Vector Graphics, is an open W3C Standard (unlike the proprietary Adobe Flash). One of the biggest advantages to using SVG is that it automatically scales to any size. Enlarging an SVG image (or animation) doesn’t degrade its quality, unlike with JPEG, PNG and other image formats.

      SVG is currently popular for applications in mobile phones and other devices. Perhaps the Apple iPhone will have the star power to get SVG widely used on the Web. SVG is already supported by Opera, Firefox and Safari.

    • svwebbuilder says:

      SVG

      Mobile Safari supports SVG starting with the iPhone firmware 2.1. The SVG support features scripting and most of the static parts of the SVG 1.1. specification. SMIL animation is not yet supported for SVG graphics. It will be delivered after the Webkit SMIL implementation is mature enough. In addition to SVG, the HTML Canvas is supported.

    • svwebbuilder says:

      It seems like SVG doesn’t work natively on UIView. UIWebView does support SVG. SVG is supported when you call up Safari that is based on Webkit.

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

What’s this?

You are currently reading Stanford iPhone programming class 1st Demo – Why it fails in class at Web Builders.

meta

%d bloggers like this: