39
-
Upload
anurag-sukhija -
Category
Technology
-
view
240 -
download
4
description
Transcript of 39
![Page 1: 39](https://reader035.fdocuments.in/reader035/viewer/2022062510/54b558814a7959e36b8b45ae/html5/thumbnails/1.jpg)
Sequence for iPhone Development
Design for Mobile DevicesFall 2010
University of Baltimore
![Page 2: 39](https://reader035.fdocuments.in/reader035/viewer/2022062510/54b558814a7959e36b8b45ae/html5/thumbnails/2.jpg)
Create a Project
• XCode:• File…New Project– iPhone OS– Window Based Application– Name Project File
![Page 3: 39](https://reader035.fdocuments.in/reader035/viewer/2022062510/54b558814a7959e36b8b45ae/html5/thumbnails/3.jpg)
Create the User Interface
• Interface Builder:– View MainWindow.xib– Open under Tools• Library• Inspector
– Drag UI objects to the Window– Set attributes
![Page 4: 39](https://reader035.fdocuments.in/reader035/viewer/2022062510/54b558814a7959e36b8b45ae/html5/thumbnails/4.jpg)
Create the Controller Class
• XCode:– File…New File– Class: Cocoa Touch Class– Subclass: NSObject
Two file are created:Controller.h -> holds instance variablesController.m -> source file of methods to run App
![Page 5: 39](https://reader035.fdocuments.in/reader035/viewer/2022062510/54b558814a7959e36b8b45ae/html5/thumbnails/5.jpg)
Create Instance Variables
• XCode:– Controller.h -> declare variables
![Page 6: 39](https://reader035.fdocuments.in/reader035/viewer/2022062510/54b558814a7959e36b8b45ae/html5/thumbnails/6.jpg)
Create Controller Object
• Interface Builder:– MainWindow.mib– Library• Drag Object to mainWindow.mib
– Inspector• Choose identity tab
– Change NSObject to Controller
![Page 7: 39](https://reader035.fdocuments.in/reader035/viewer/2022062510/54b558814a7959e36b8b45ae/html5/thumbnails/7.jpg)
Connect Objects to Instance Variables
• Interface Builder:– MainWindow.xib– Window– Inspector• Click on connections tab
– Connect Outlets (variables) to Objects (fields, etc)– Connect Actions to Events
• Use Simulator to view actions – no results yet
![Page 8: 39](https://reader035.fdocuments.in/reader035/viewer/2022062510/54b558814a7959e36b8b45ae/html5/thumbnails/8.jpg)
Write Source Methods
• XCode:– Controller.m
1. awakeFromNib2. calculateTip
![Page 9: 39](https://reader035.fdocuments.in/reader035/viewer/2022062510/54b558814a7959e36b8b45ae/html5/thumbnails/9.jpg)
Run iPhone Simulator
![Page 10: 39](https://reader035.fdocuments.in/reader035/viewer/2022062510/54b558814a7959e36b8b45ae/html5/thumbnails/10.jpg)
Create iPhone App Icon (1)
• Clear old icons from iPhone Simulator– Finder…Library … Application Support … iPhone Simulator– Drag iPhone Simulator to trash
![Page 11: 39](https://reader035.fdocuments.in/reader035/viewer/2022062510/54b558814a7959e36b8b45ae/html5/thumbnails/11.jpg)
Create iPhone App Icon (2)
• Create a 57 x 57 .png file
![Page 12: 39](https://reader035.fdocuments.in/reader035/viewer/2022062510/54b558814a7959e36b8b45ae/html5/thumbnails/12.jpg)
Create iPhone App Icon (3)
• Save file to Xcode Resources folder– Open Finder, Locate .png file– Open Xcode Resources folder– Drag .png file to Resources file.– A dialog box pops up – check Copy … and Click Add
![Page 13: 39](https://reader035.fdocuments.in/reader035/viewer/2022062510/54b558814a7959e36b8b45ae/html5/thumbnails/13.jpg)
Create iPhone App Icon (4)
• Add to Property list– Click on Info.plist– Enter name of icon file to plist
![Page 14: 39](https://reader035.fdocuments.in/reader035/viewer/2022062510/54b558814a7959e36b8b45ae/html5/thumbnails/14.jpg)
Review Steps to Create an iPhone App
1. Create a project in Xcode.2. Create the user interface in Interface Builder (IB).3. Create the controller class in Xcode.4. Create the instance variables in Xcode.5. Create the Controller Object in IB.6. Connect Objects to Instance Variables in IB.7. Write source code in Xcode.8. Test in iPhone Simulator.9. Create app icon.