Objective-C Crash Course for Web Developers
Upcoming SlideShare
Loading in...5
×
 

Objective-C Crash Course for Web Developers

on

  • 7,629 views

These are the slides of my SXSW 2010 Objective-C Crash Course for Web Developers.

These are the slides of my SXSW 2010 Objective-C Crash Course for Web Developers.

The code samples (and the keynote document) can also be downloaded from http://workshop.verbogt.nl/

Statistics

Views

Total Views
7,629
Views on SlideShare
7,480
Embed Views
149

Actions

Likes
7
Downloads
201
Comments
1

14 Embeds 149

http://dr-palaniraja.blogspot.com 91
http://www.slideshare.net 33
http://dr-palaniraja.blogspot.in 7
http://dr-palaniraja.blogspot.fr 3
http://dr-palaniraja.blogspot.co.uk 3
http://dr-palaniraja.blogspot.ro 2
http://dr-palaniraja.blogspot.se 2
http://dr-palaniraja.blogspot.cz 2
http://dr-palaniraja.blogspot.ru 1
http://dr-palaniraja.blogspot.ie 1
http://dr-palaniraja.blogspot.jp 1
http://dr-palaniraja.blogspot.it 1
http://dr-palaniraja.blogspot.com.br 1
http://www.linkedin.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Is there a video available for these?
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • <br />
  • <br />
  • Chief Developer <br /> Backend stuff / JavaScript integration <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • Basic description <br />
  • <br />
  • <br />
  • Questions at the end <br /> Except for things that aren&#x2019;t clear <br />
  • Questions at the end <br /> Except for things that aren&#x2019;t clear <br />
  • Questions at the end <br /> Except for things that aren&#x2019;t clear <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />

Objective-C Crash Course for Web Developers Objective-C Crash Course for Web Developers Presentation Transcript

  • Objective-C Crash Course for Web Developers
  • About me
  • About me LinkedIn: jverbogt Twitter: silentjohnny Facebook: silentjohnny E-mail: joris@mangrove.nl
  • History
  • iPhone SDK
  • AppStore
  • Build your own
  • TXXI
  • Today’s Topics
  • Today’s Topics
  • Today’s Topics Native iPhone Development
  • Today’s Topics Native iPhone Development Live Demo
  • Today’s Topics Native iPhone Development Live Demo Questions
  • iPhone Development
  • iPhone Development Tools: Xcode / Interface Builder
  • iPhone Development Tools: Xcode / Interface Builder Language: Objective-C
  • iPhone Development Tools: Xcode / Interface Builder Language: Objective-C Frameworks: Foundation / UIKit
  • Xcode
  • Xcode Editor
  • Xcode Editor Debugger
  • Xcode Editor Debugger Build Tools
  • Xcode Editor Debugger Build Tools Documentation
  • Interface Builder
  • Interface Builder Design UI
  • Interface Builder Design UI Bind to code
  • Interface Builder Design UI Bind to code Generate code
  • iPhone Simulator
  • iPhone Simulator Easy for debugging
  • iPhone Simulator Easy for debugging No device needed
  • iPhone Simulator Easy for debugging No device needed Fast round-trip
  • Not a real iPhone!
  • Objective-C
  • Objective-C
  • Objective-C Superset of C, can be mixed
  • Objective-C Superset of C, can be mixed Simple syntax
  • Objective-C Superset of C, can be mixed Simple syntax Dynamic runtime
  • OOP in Objective-C
  • OOP in Objective-C
  • OOP in Objective-C Single inheritance class tree
  • OOP in Objective-C Single inheritance class tree Protocols for multi-class behavior
  • OOP in Objective-C Single inheritance class tree Protocols for multi-class behavior Instance variables are hidden
  • OOP in Objective-C Single inheritance class tree Protocols for multi-class behavior Instance variables are hidden Objects respond to messages for interaction
  • OOP in Objective-C Single inheritance class tree Protocols for multi-class behavior Instance variables are hidden Objects respond to messages for interaction Variables are bound to classes at runtime
  • OOP in Objective-C Single inheritance class tree Protocols for multi-class behavior Instance variables are hidden Objects respond to messages for interaction Variables are bound to classes at runtime There is an anonymous object type ‘id’
  • Syntax
  • Syntax
  • Syntax float moneyInTheBank = 0.0;
  • Syntax float moneyInTheBank = 0.0; var moneyInTheBank = 0.0;
  • Syntax
  • Syntax MacBookPro *myNewMac = [MacBookPro new];
  • Syntax MacBookPro *myNewMac = [MacBookPro new]; var myNewMac = new MacBookPro();
  • Syntax
  • Syntax if (moneyInTheBank > [myNewMac price]) { // Go buy one! }
  • Syntax if (moneyInTheBank > [myNewMac price]) { // Go buy one! } if (moneyInTheBank > myNewMac.getPrice()) { // Go buy one! }
  • Syntax
  • Syntax for (i=1; i<count; i++) { }
  • Messaging
  • Messaging
  • Messaging NSString *name = [person name];
  • Messaging NSString *name = [person name]; var name = person.getName();
  • Messaging
  • Messaging [person setName:@”John”];
  • Messaging [person setName:@”John”]; person.setName(”John”);
  • Messaging
  • Messaging NSUInteger length = [[person name] length];
  • Messaging NSUInteger length = [[person name] length]; var length = person.getName().getLength();
  • Messaging
  • Messaging [person setName:name andAge:21];
  • Messaging [person setName:name andAge:21]; person.set({name:name, age:21});
  • Creating Instances
  • Creating Instances
  • Creating Instances Person *person = [[Person alloc] init];
  • Creating Instances Person *person = [[Person alloc] init]; Person *person = [Person new];
  • Creating Instances Person *person = [[Person alloc] init]; Person *person = [Person new]; Person *person = [Person person];
  • Memory Management
  • Memory Management
  • Memory Management If you allocate memory, you need to clean it up!
  • Memory Management
  • Memory Management NSObject *keepMe = [[NSObject alloc] init];
  • Memory Management NSObject *keepMe = [[NSObject alloc] init]; [keepMe retain];
  • Memory Management NSObject *keepMe = [[NSObject alloc] init]; [keepMe retain]; [keepMe autorelease];
  • Memory Management NSObject *keepMe = [[NSObject alloc] init]; [keepMe retain]; [keepMe autorelease]; [keepMe release];
  • Memory Management NSObject *keepMe = [[NSObject alloc] init]; [keepMe retain]; [keepMe autorelease]; [keepMe release]; NSObject *keepMe = [NSObject object];
  • Categories
  • Categories
  • Categories Extending classes without subclassing
  • Categories Extending classes without subclassing NSString *json = @”{“test”:”OK”}”;
  • Categories Extending classes without subclassing NSString *json = @”{“test”:”OK”}”; SBJsonParser *parser = [[SBJsonParser] alloc] init]; NSDictionary *data = [parser objectWithString:json];
  • Categories Extending classes without subclassing NSString *json = @”{“test”:”OK”}”; NSDictionary *data = [json JSONValue];
  • Categories
  • Categories String.prototype.getJSONValue = function() { return ... };
  • Categories String.prototype.getJSONValue = function() { return ... }; var json = “{”test”:”OK”}”; var myObject = json.getJSONValue();
  • Foundation Classes
  • NSString
  • NSString
  • NSString NSString *myName = @”joris”;
  • NSString NSString *myName = @”joris”; NSString *welcome = [NSString stringWithFormat:@”Hello %@”, name];
  • NSString NSString *myName = @”joris”; NSString *welcome = [NSString stringWithFormat:@”Hello %@”, name]; NSString *greeting = @”Hello ”; NSString *welcome = [greeting stringByAppendingString:name];
  • NSString NSString *myName = @”joris”; NSString *welcome = [NSString stringWithFormat:@”Hello %@”, name]; NSString *greeting = @”Hello ”; NSString *welcome = [greeting stringByAppendingString:name]; if ([myName isEqualToString:otherName]) { // Strings are equal! }
  • NSArray
  • NSArray
  • NSArray NSArray *myArray = [NSArray arrayWithObjects:@”me”, @”you”, nil];
  • NSArray NSArray *myArray = [NSArray arrayWithObjects:@”me”, @”you”, nil]; NSUInteger count = [myArray count];
  • NSArray NSArray *myArray = [NSArray arrayWithObjects:@”me”, @”you”, nil]; NSUInteger count = [myArray count]; NSString *secondItem = [myArray objectAtIndex:1];
  • NSArray NSArray *myArray = [NSArray arrayWithObjects:@”me”, @”you”, nil]; NSUInteger count = [myArray count]; NSString *secondItem = [myArray objectAtIndex:1]; for (NSString *name in myArray) { NSLog(@”Name: %@”, name); }
  • NSDictionary
  • NSDictionary
  • NSDictionary NSDictionary *myDict = [NSDictionary dictionaryWithObjectsAndKeys: @”joris”, @”firstname”, @”verbogt”, @”lastname”, nil];
  • NSDictionary NSDictionary *myDict = [NSDictionary dictionaryWithObjectsAndKeys: @”joris”, @”firstname”, @”verbogt”, @”lastname”, nil]; NSString *lastname = [myDict objectForKey:@”lastname”];
  • UIKit
  • Delegates
  • Delegates
  • Delegates Many UIKit classes define delegate protocols
  • Delegates Many UIKit classes define delegate protocols No subclassing necessary for custom behavior
  • Delegates Many UIKit classes define delegate protocols No subclassing necessary for custom behavior Loose coupling
  • Delegates Many UIKit classes define delegate protocols No subclassing necessary for custom behavior Loose coupling Easy refactoring
  • Connecting UI Elements
  • Connecting UI Elements
  • Connecting UI Elements Code defines outlets to UI elements
  • Connecting UI Elements Code defines outlets to UI elements Code responds to actions from UI
  • Connecting UI Elements Code defines outlets to UI elements Code responds to actions from UI UI Elements fire actions to a target
  • Connecting UI Elements Code defines outlets to UI elements Code responds to actions from UI UI Elements fire actions to a target Again: no subclassing
  • ViewControllers
  • ViewControllers
  • ViewControllers Control a UI view (with sub-views)
  • ViewControllers Control a UI view (with sub-views) Ready to use, out-of-the-box
  • ViewControllers Control a UI view (with sub-views) Ready to use, out-of-the-box Can be stacked for navigation
  • ViewControllers Control a UI view (with sub-views) Ready to use, out-of-the-box Can be stacked for navigation Can be initialized from code or IB
  • ViewControllers
  • ViewControllers Useful Subclasses:
  • ViewControllers Useful Subclasses: TableViewController
  • ViewControllers Useful Subclasses: TableViewController NavigationController
  • ViewControllers Useful Subclasses: TableViewController NavigationController TabBarController
  • Let’s do some coding...
  • Why?
  • Why?
  • Why? Fun challenge
  • Why? Fun challenge Frameworks
  • Why? Fun challenge Frameworks Best User Experience
  • Why? Fun challenge Frameworks Best User Experience Inspiration
  • Thank you
  • Copyright Artwork by nozzman.com Presentation by Joris Verbogt This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Netherlands License. Download at http://workshop.verbogt.nl/