Your SlideShare is downloading. ×
0
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

iPhone Programming in 30 minutes (?) [FTS]

1,237

Published on

Talk at PhD Computer Science students’ Journal Club in Cardiff University (FTS - Food, Talks and Stuff).

Talk at PhD Computer Science students’ Journal Club in Cardiff University (FTS - Food, Talks and Stuff).

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,237
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
53
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  1. FTS seminar 27.01.2010 iPhone Programming in ~30 mins (?) Diego Pizzocaro
  2. DisclaimerThese slides are heavily based on Evan Doll and Alan Cannistraro’s slides prepared for iPhone App Programming course @ Stanford http://www.stanford.edu/class/cs193p Look for iPhone Application Programming in iTunes U for videopodcasts.
  3. Crash course• iPhone OS overview• Objective-C• Model-View-Controller (MVC)
  4. iPhone OS overview
  5. iPhone
  6. Mac OS X Cocoa Media Core Services Core OS
  7. iPhoneCocoa Touch UI application framework which as a developer you Media are using the mostCore Services Core OS
  8. Developing on iPhone Tools ToolsTools Xcode Interface Builder Xcode Xcode Interface Builder Interface Builder Tools Xcode Interface Builder Cocoa Touch FrameworksFrameworks Frameworks Frameworks Foundation Foundation UIKit UIKit Foundation Foundation UIKit UIKit LanguageLanguage Language [textView setStringValue: @“Hello”]; [textView setStringValue: @“Hello”]; [textView setStringValue: @“Hello”]; (& Runtime)(& Runtime) (& Runtime) Language [textView setStringValue: @“Hello”]; Objective-C Objective-C Objective-C (& Runtime) Objective-C
  9. Objective-C
  10. Objective-C• Strict superset of C ‣ Mix C with Obj-C• Object oriented language• Based on message passing (similar to Smalltalk)• No garbage collector need to manually manage memory (not covered in this presentation)
  11. Message Syntax[receiver message];[receiver message:argument];[receiver message:arg1 andArg:arg2];
  12. Message ExamplesBankAccount *myAccount; //assume this existsint n = [myAccount accountNumber];[myAccount deposit:100];if([myAccount isNotEmpty]) { [myAccount withdraw:50 printReceipt:YES];}
  13. Some new types• Anonymous Objects• Class• ...others but no time! (Selectors “SEL”, Boolean “BOOL”, etc.)
  14. Anonymous Objects• Normal (or Statically-typed) object BankAccount *anAccount• Anonymous (or Dynamically-typed) object id anAccount - Just id (Not id*) - id is the data type that indicates that we are talking about an object
  15. Class• class instances responds to instance methods “-” - (id)init; - (double)accountNumber; int n = [myAccount accountNumber];• classes responds to class methods “+” (like Java “static” methods) + (id)alloc; + (float)stdInterestRate; float rate = [BankAccount stdInterestRate];
  16. Defining aaclass Defining a class Defining classA public header and a private implementation A public header and a private implementation A public header and a private implementation Header File File Header Header File Implementation File Implementation File File Implementation
  17. Defining a class Defining a class DemoA public header and a private implementation A public header and a private implementation BankAccount class BankAccount.h Header File File Header BankAccount.m Implementation File File Implementation
  18. Model - View - Controller (MVC)
  19. Address Book
  20. App ArchitectureModel View Controller
  21. MVC• Only the Controller knows both Model and View• Makes code more reusable (especially the Model part) Interface Builder Model View Controller Xcode
  22. Demo BankAccount app View Model ✓ MainWindow.xib BankAccount BankAccount BankAccount balance balancebalance Value Changed - initWithBalance EVENT- -initWithBalance -initWithBalance setBalance -setBalance setBalance- - balance--balance balance Controller AccountController slider Outlets label myBankAccount Action - updateAccount
  23. Demo BankAccount app View Model ✓ MainWindow.xib BankAccount BankAccount BankAccount balance balancebalance Value Changed - initWithBalance EVENT- -initWithBalance -initWithBalance setBalance -setBalance setBalance- - balance--balance balance Controller AccountController slider label myBankAccount - updateAccount
  24. Your turn! ;) • http://www.stanford.edu/class/cs193p • http://cs193p.com/ • iTunes U - “iPhone Application Programming” • iPhone Developer Program (FREE, but cannot deploy on real iPhone) • users.cs.cf.ac.uk/D.PizzocaroImage from: http://www.trumpetvine.com/sketchblog/wp-content/images/2007.07/iphone_lg.jpg

×