DOC PREVIEW
CU-Boulder CSCI 5448 - INTRODUCTION TO IOS

This preview shows page 1-2-3-4-25-26-27-52-53-54-55 out of 55 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

© Kenneth M. Anderson, 2011INTRODUCTION TO IOSCSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGNLECTURE 13 — 02/22/20111Tuesday, February 22, 2011© Kenneth M. Anderson, 2011Goals of the LecturePresent an introduction to iOS ProgramCoverage of the language will be INCOMPLETEWe’ll see the basics… there is a lot more to learn2Tuesday, February 22, 2011© Kenneth M. Anderson, 2011HistoryiOS is the name (as of version 4.0) of Apple’s platform for mobile applicationsThe iPhone was released in the summer of 2007According to Wikipedia, it has been updated 30 times since then, with the 31st update slated to occur when version 4.3 is released soon (currently in beta)iOS apps can be developed for iPhone, iPod Touch and iPad; iOS is used to run Apple TV but apps are not currently supported for that program3Tuesday, February 22, 2011© Kenneth M. Anderson, 2011iOS 4.2I’ll be covering iOS 4.2 which is the current “official version”Version 4.2 in November 2010 was significant in that it represented the first time that the same OS ran across all three hardware platformsUntil that release iPad had been running version 3.2 which had been created specifically for that device4Tuesday, February 22, 2011© Kenneth M. Anderson, 2011Acquiring the SoftwareTo g e t t h e s o f t w a r e r e q u i r e d t o d e v e l o p i n i O SGo to http://developer.apple.com/ Click on iOS Dev CenterLog in (free registration is required)Download the release calledXcode 3.2.5 and iOS SDK 4.3Double click the .dmg and run the installer5Tuesday, February 22, 2011© Kenneth M. Anderson, 2011To o l sXcode: Integrated Development EnvironmentProvides multiple iOS application templatesInterface BuilderProvides drag-and-drop creation of user interfacesiPhone SimulatorProvides ability to test your software on iPhone & iPadInstruments: Profile your application at runtime6Tuesday, February 22, 2011© Kenneth M. Anderson, 2011iOS Platform (I)The iOS platform is made up of several layersThe bottom layer is the Core OSOS X Kernel, Mach 3.0, BSD, Sockets, File System, …The next layer up is Core ServicesCollections, Address Book, SQLite, Networking, Core Location, Threading, Preferences, …7Tuesday, February 22, 2011© Kenneth M. Anderson, 2011iOS Platform (II)The iOS platform is made up of several layersThe third layer is the Media layerCore Audio, OpenGL and OpenGL ES, Video and Image support, PDF, Quartz, Core AnimationThe final layer is Cocoa Touch (Foundation/UIKit)Views, Controllers, Multi-Touch events and controls, accelerometer, alerts, web views, etc.An app can be written using only layer 4 but advanced apps can touch all four layers8Tuesday, February 22, 2011© Kenneth M. Anderson, 2011Introduction to Interface Builder (I)Interface Builder is extremely powerfulIt provides a drag and drop interface for constructing the graphical user interface of your appsThe GUIs created by Interface Builder are actual instances of the underlying UIKit classesWhen you save an Interface Builder file, you “freeze dry” the objects and store them on the file systemWhen your app runs, the objects get reconstituted and linked to your application logic9Tuesday, February 22, 2011© Kenneth M. Anderson, 2011Introduction to Interface Builder (II)This object-based approach to UI creation is what provides interface builder its powerTo d e m o n s t r a t e t h e p o w e r o f I n t e r f a c e B u i l d e r, l e t ’s create a simple web browser without writing a single line of codeThe fact that we can do this is testament to the power of object-oriented techniques in general10Tuesday, February 22, 2011© Kenneth M. Anderson, 2011Step One: Create ProjectLaunch XCode and create a MacOS X application (we’ll get to iOS in a minute)Unlike last time, select Cocoa Application rather than Command Line ToolName the project WebBrowser and save it to diskClick Build and Run to see that the default template produces a running applicationIt doesn’t do anything but create a blank window11Tuesday, February 22, 2011© Kenneth M. Anderson, 2011Step Two: Launch IBExpand ResourcesDouble click MainMenu.xibxib stands for “XML Interface Builder”; it is an XML file that stores the freeze dried objects that interface builder creates; You will never edit it directlyInterface Builder will launch12Tuesday, February 22, 2011© Kenneth M. Anderson, 2011Interface Builder UI13Shows the objects instantiated for our default projectWindow and Menu represent actual instances of NSWindow and NSMenuYou can esta blish connections between the objects in Interface BuilderTuesday, February 22, 2011© Kenneth M. Anderson, 2011Our default Window14This is the window you saw when you ran the application back in Step One;Exciting, isn’t itTry changing its size, save the document, switch back to Xcode and run the programYou’ll see your changes reflectedTuesday, February 22, 2011© Kenneth M. Anderson, 2011Step 3: Acquire Widgets15Invoke Tools 󲰛 Library to bring up the widgets that can be dragged and dropped onto our windowType button in the search field and then drag two “push buttons” on to the windowIt doesn’t matter where you drag them just yetType t ex t fie l d i n t he se a rc h fie l d a nd th e n d r ag a “t e x t field” on to the window (ignore “text field cell”)Type “ web” a n d d r ag a “ web v ie w ” t o t h e w in d owTuesday, February 22, 2011© Kenneth M. Anderson, 2011Results of Step 316Window now has four widgets but they are not yet placed where we want themTuesday, February 22, 2011© Kenneth M. Anderson, 2011Step 4: Layout Widgets (I)17Put the buttons in the upper right cornerUse the guides to space them correctlyDouble click on them and name one “Back” and one “Forward”Put the text field in the upper left corner and stretch it out so it ends up next to the buttonsAgain use the guides to get the spacing rightThese guides help you follow Apple’s human interface guidelinesTuesday, February 22, 2011© Kenneth M. Anderson, 2011Step 4: Layout Widgets (II)18Expand the Web view so that it now fills the rest of the window, following the guides to leave the appropriate amount of spaceYour window now looks like the image on the next slideTuesday, February 22, 2011© Kenneth M. Anderson, 201119Everything is fine until you try to resize the window. Click ⌘-R and try it outTuesday, February 22, 2011© Kenneth M. Anderson, 201120Whoops!Fortunately, Interface Builder


View Full Document

CU-Boulder CSCI 5448 - INTRODUCTION TO IOS

Documents in this Course
Django

Django

42 pages

ENRS

ENRS

30 pages

PhoneGap

PhoneGap

22 pages

Load more
Download INTRODUCTION TO IOS
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view INTRODUCTION TO IOS and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view INTRODUCTION TO IOS 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?