Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Objective-C Introduction part1

Objective-C Introduction part1

An extended -barely- version of the Objective-C introduction at CocoaHeadsGDL.

Tweet

More Decks by Juan Pablo Ortiz Aréchiga

Other Decks in Programming

Transcript

  1. History • Born in the 80’s by Brad Cox and

    Tom Love • A C’s pre-processor • C + Smalltalk = Obj-C • Not really popular viernes 23 de marzo de 12
  2. • NeXT was a failure on hardware, but success on

    building tools • GNU cloned the compiler in the 90s • Apple buys NeXT, relies Objective-C and NeXT tools viernes 23 de marzo de 12
  3. Objective-C • Bunch of C extensions • You can write

    plain C without problems • Interfaces (.h) and implementations (.m) viernes 23 de marzo de 12
  4. Creating objects or autorelease Everytime you use init or retain,

    it’s your responsability to release viernes 23 de marzo de 12
  5. 3 ways to handle memory • Manual reference counting •

    Garbage collector* (only on Mac) • ARC viernes 23 de marzo de 12
  6. ARC • Memory Management? that’s so 2011 • Automatic Reference

    Counting • Xcode 4.2+ • Compatible with iOS 4.x* and iOS 5.x viernes 23 de marzo de 12
  7. nil every message sent to nil will be ignored, the

    app won’t crash viernes 23 de marzo de 12
  8. Delegate Pattern • Handing a task to another part of

    the program. • i.e. a TableView may notify it’s delegate when a single row was tapped so the program can take an action. viernes 23 de marzo de 12