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

Tips & Tricks for iPhone Application Development

Tips & Tricks for iPhone Application Development

Presentation shown during a SkillsMatter event in London, United Kingdom.

88dd97cf2dc7f06cc51a01d450f0b1e5?s=128

Adrian Kosmaczewski
PRO

February 02, 2010
Tweet

Transcript

  1. Tips & Tricks for iPhone Application Development Skills Matter -

    London - February 2nd 2010
  2. None
  3. Adrian Kosmaczewski

  4. akosma software akosma.com akosma.tumblr.com github.com/akosma linkedin.com/in/akosma facebook.com/akosma

  5. @akosma

  6. None
  7. some questions

  8. new to iPhone?

  9. designer? developer?

  10. technologies?

  11. Android J2EE J2ME .NET Ruby on Rails others?

  12. programming languages?

  13. C / C++? Java, C#? Ruby, Python, Lua? JavaScript?

  14. None
  15. Dev Days for iPhone

  16. Mon, April 26th 2010

  17. Win a free ticket!

  18. Fill your evaluation form! :)

  19. None
  20. iPhone dev ≠ web dev

  21. None
  22. Cocoa & Objective-C

  23. born in the 80s

  24. None
  25. None
  26. None
  27. None
  28. Objective-C

  29. Objective-C Java @interface & @implementation class (1 file) @protocol interface

    #import // files! import // classes! categories n/a (in C#, “class extensions”) id n/a (generics?)
  30. Objective-C Java @selector n/a NSObject / NSProxy / ... Object

    @public / @protected / @private public / protected / private @try / @catch / @finally NSException try / catch / finally Exception n/a package / namespace
  31. • Thin layer around C • Message-dispatch runtime • Static

    and dynamic (you choose) • The “real” inspiration for Java: • http://cs.gmu.edu/~sean/stuff/java- objc.html
  32. • Single inheritance + interfaces (“@protocols”) • @protocols can have

    optional methods • Fields protected by default • All methods are virtual and overridable • Methods can be added to existing classes • Full introspection / reflection • Messages can be intercepted and forwarded à la AOP
  33. None
  34. None
  35. None
  36. None
  37. Demo

  38. None
  39. Cocoa Touch

  40. None
  41. None
  42. iPhone Specifics

  43. None
  44. 128 or 256 MB RAM

  45. ~70 MB for the OS!

  46. no swap file

  47. (no virtual memory)

  48. no garbage collector

  49. (manual memory management)

  50. http://cocoadevcentral.com/d/learn_objectivec/

  51. no automatic objects on the stack (C++)

  52. // C++ // Memory freed when out of scope std::string

    name(“Adrian”); std::string *name = NULL; name = new std::string(“Adrian”); delete name;
  53. hygiene

  54. None
  55. memory warnings

  56. None
  57. avoid autorelease

  58. None
  59. None
  60. lazy-loading & reuse

  61. None
  62. custom table cells & reuse

  63. None
  64. override setters properly

  65. None
  66. beware of delegation

  67. None
  68. instruments & static analysis

  69. None
  70. warnings as errors

  71. None
  72. code organization

  73. (cheaper maintenance)

  74. None
  75. iPhone ≠ computer

  76. http://www.flickr.com/photos/oskay/365607662/

  77. http://www.flickr.com/photos/blakespot/2379207825/

  78. http://www.flickr.com/photos/oskay/365607591/

  79. Mobile HIG

  80. now more important than ever!

  81. None
  82. None
  83. None
  84. None
  85. NDA

  86. None
  87. books

  88. None
  89. None
  90. None
  91. None
  92. None
  93. None
  94. None
  95. None
  96. None
  97. thanks!

  98. Please fill your evaluation forms!

  99. (you could win a ticket)

  100. questions?