iPhone Tech Talk

3,240 views

Published on

This tech talk was given by Jon Rexeisen and Minh Vu at the Nerdery on May 13, 2009. It covers the basics of development for the iPhone.

Published in: Technology
1 Comment
2 Likes
Statistics
Notes
No Downloads
Views
Total views
3,240
On SlideShare
0
From Embeds
0
Number of Embeds
704
Actions
Shares
0
Downloads
117
Comments
1
Likes
2
Embeds 0
No embeds

No notes for slide




  • In 1994 NeXT and Sun standardized the language called Openstep.
    Foundation of OS X
    2007 Objective-C 2.0 released
  • In 1994 NeXT and Sun standardized the language called Openstep.
    Foundation of OS X
    2007 Objective-C 2.0 released
  • In 1994 NeXT and Sun standardized the language called Openstep.
    Foundation of OS X
    2007 Objective-C 2.0 released
  • In 1994 NeXT and Sun standardized the language called Openstep.
    Foundation of OS X
    2007 Objective-C 2.0 released

  • This is bizarre and a large part of the hurdle of learning Objective C
    Most native objects (NSArray, NSString, NSNumber) come from NeXTStep
  • This is bizarre and a large part of the hurdle of learning Objective C
    Most native objects (NSArray, NSString, NSNumber) come from NeXTStep
  • synthesize automatically creates getters and setters
    @property makes it public
  • Note that iPhone development requires and Intel based Mac running Leopard
  • Note that iPhone development requires and Intel based Mac running Leopard
  • Note that iPhone development requires and Intel based Mac running Leopard







  • Mention the time that it takes to enroll in each
  • Mention the time that it takes to enroll in each
  • Mention the time that it takes to enroll in each
  • Mention the time that it takes to enroll in each














  • iPhone Tech Talk

    1. 1. iPhone Tech Talk 5.13.2009
    2. 2. Outline
    3. 3. Outline • Overview of Objective C
    4. 4. Outline • Overview of Objective C • Interface Builder and XCode
    5. 5. Outline • Overview of Objective C • Interface Builder and XCode • iPhone App Store
    6. 6. History
    7. 7. History • Started in 1980, layered on C language
    8. 8. History • Started in 1980, layered on C language • NeXT Licensed 1988
    9. 9. History • Started in 1980, layered on C language • NeXT Licensed 1988 • Added to Free Software Foundation GNU in 1992
    10. 10. History • Started in 1980, layered on C language • NeXT Licensed 1988 • Added to Free Software Foundation GNU in 1992 • Apple acquired NeXT in 1996
    11. 11. Language & Development • Needs header files (*.h) and implementation files (*.m) • Can mix C and Objective C • Cocoa enforces MVC framework • Can also write OpenGL applications
    12. 12. Syntax UIView *view = [[UIView alloc] init]; [view setBackgroundColor:[UIColor whiteColor]];
    13. 13. Syntax UIView *view = [[UIView alloc] init]; [view setBackgroundColor:[UIColor whiteColor]]; PHP $view = new UIView(); $view->backgroundColor(UIColor::whiteColor);
    14. 14. Syntax UIView *view = [[UIView alloc] init]; [view setBackgroundColor:[UIColor whiteColor]]; PHP $view = new UIView(); $view->backgroundColor(UIColor::whiteColor); Actionscript var view:UIView = new UIView(); view.backgroundColor(UIColor.whiteColor);
    15. 15. Example 1 #import <UIKit/UIKit.h> 2 3 @interface Foo : NSObject { 4 NSString *myString; 5 } 6 @property NSString *myString; 7 - (NSNumber *) getANSNumber; 8 + (void) callStaticMethod; 9 @end 10 11 @implementation Foo 12 @synthesize myString; 13 - (id)init { 14 self = [super init]; 15 [self setMyString: @”ASDF”]; 16 return self; 17 } 18 @end
    16. 16. Tools
    17. 17. Tools XCode
    18. 18. Tools XCode Interface Builder
    19. 19. Tools XCode Interface Builder Tools to develop iPhone/Mac applications is free to anyone who runs a machine with OS X
    20. 20. UINavigation Elements
    21. 21. Demo
    22. 22. Interface Builder Mode Attribute • Define how the object will be aligned inside the view. Tag • Language-independent way of identifying objects on your interface. • Multiple button using same method can be identified via tag Opaque • Tells iPhone OS that nothing below your view should be drawn and allows iPhones’s drawing method to do some optimizations that speed up drawing Clip Subviews •If your view has subviews and this option is checked. Then only the portion of your subview that is within the bound of your view is drawn. •This option is turned off by default for performance reason. Clear Context before Drawing •iPhone will draw the entire area covered by the control in transparent black before it actually draws the control.
    23. 23. Demo
    24. 24. Memory Management iPhone version of Objective-C uses Retain/Release count method to manage memory. Retain count is affected by: • alloc – NSString *label = [[NSString alloc] initWithString:@quot;Labelquot;]; • copy – NSString *label2 = [label copy]; • new - Point *point = [Point new]; • retain – [label2 retain]; Balance retain count with release • release – [label2 release]; Autorelease Object •returned from factory method •NSString *label = [NSString stringWithFormat:@quot;label %dquot;, 2]; • get added to autorelease pool that is released at the end of the run loop
    25. 25. Memory Usage iPhone app has access to limited memory • Memory warning via didReceiveMemoryWarning method • Use Instruments to find leaks or performance enhancement. • Use lazy loading • Watch autorelease footprint • If needed create autorelease pool • Watch custom setter method • Reuse memory • Update existing object rather then creating new ones • UITableView uses dequeueReusableCellWithIdentifier: method •Returns a reusable table-view cell object located by its identifier
    26. 26. Demo
    27. 27. Developer Program
    28. 28. Developer Program • $99 for individual
    29. 29. Developer Program • $99 for individual • $99 for company
    30. 30. Developer Program • $99 for individual • $99 for company • $299 for enterprise
    31. 31. Developer Program • $99 for individual • $99 for company • $299 for enterprise • Meant for developers!
    32. 32. Beta Testing & Distribution
    33. 33. Beta Testing & Distribution • Provisioning profiles
    34. 34. Beta Testing & Distribution • Provisioning profiles • Can install development builds through XCode
    35. 35. Beta Testing & Distribution • Provisioning profiles • Can install development builds through XCode • Ad Hoc distribution for external beta testing
    36. 36. Beta Testing & Distribution • Provisioning profiles • Can install development builds through XCode • Ad Hoc distribution for external beta testing • App Store - get in EARLY!
    37. 37. Approval Process • Don’t add obscenities, pornography, etc • Follow Apple Human Interface Guidelines • Don’t collect data without user’s consent • Don’t write malicious software • Don’t write an app that Apple is already writing
    38. 38. Approval Process
    39. 39. iPhone 3.0
    40. 40. iPhone 3.0 • All Apps being reviewed in iPhone 3.0
    41. 41. iPhone 3.0 • All Apps being reviewed in iPhone 3.0 • Push Notifications
    42. 42. iPhone 3.0 • All Apps being reviewed in iPhone 3.0 • Push Notifications • Internal Maps
    43. 43. iPhone 3.0 • All Apps being reviewed in iPhone 3.0 • Push Notifications • Internal Maps • Internal Mail
    44. 44. iPhone 3.0 • All Apps being reviewed in iPhone 3.0 • Push Notifications • Internal Maps • Internal Mail • Streaming Video
    45. 45. Resources • Stanford iPhone Development Class (iTunes) • Programming in Objective-C 2.0 • Beginning iPhone Development • The iPhone Developer’s Cookbook • http://www.docstoc.com/docs/3731208/11-Performance
    46. 46. Questions?

    ×