10 Commandments for iPhone Development

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

2 comments

Comments 1 - 2 of 2 previous next Post a comment

Post a comment
Embed Video
Edit your comment Cancel

1 Favorite

10 Commandments for iPhone Development - Presentation Transcript

  1. Ten Commandments for iPhone Software Development
  2. Adrian Kosmaczewski
  3. akosma software
  4. all in lowercase!
  5. akosma.com akosma.tumblr.com github.com/akosma linkedin.com/in/akosma facebook.com/akosma
  6. twitter.com/akosma kosmaczewski.net
  7. Some questions
  8. Who’s new to iPhone?
  9. Which technologies?
  10. J2EE J2ME .NET Ruby / Rails others?
  11. Which programming languages?
  12. C / C++? Java, C#? Ruby, Python, Lua? JavaScript? Fortran, Lisp, COBOL?
  13. 10 Commandments
  14. http://www.flickr.com/photos/oseillo/345879263/
  15. 1
  16. Thou shalt manage memory properly
  17. http://www.flickr.com/photos/blakespot/3030107382/
  18. 128 or 256 MB RAM
  19. ±70 MB for the OS!
  20. no swap file
  21. (no virtual memory)
  22. http://www.flickr.com/photos/cheek/699407283/
  23. no garbage collection
  24. Objects have a “retain count”
  25. http://cocoadevcentral.com/d/learn_objectivec/
  26. basic rule:
  27. for every [alloc], [retain], [copy] there must be a [release]
  28. beware:
  29. Objective-C only allows objects on the heap
  30. http://linguiniontheceiling.blogspot.com/2008/10/thats-madame-trash-heap-to-you.html
  31. No automatic objects on the stack (C++)
  32. http://www.futuregov.net/photologue/photo/2008/aug/30/stack-papers/
  33. // C++ // Memory freed when out of scope std::string name(“Adrian”); std::string *name = NULL; name = new std::string(“Adrian”); delete name;
  34. iPhone OS memory warnings
  35. http://www.flickr.com/photos/tbuser/2763035540/
  36. http://kosmaczewski.net/2009/01/28/10-iphone-memory-management-tips/
  37. 2
  38. Thou shalt remove all compiler warnings
  39. GCC_TREAT_WARNINGS_AS_ERRORS -Werror
  40. Why Warnings?
  41. • Using deprecated symbols; • Calling method names not declared in included headers; • Calling methods belonging to implicit protocols; • Forgetting to return a result in methods not returning “void”; • Forgetting to #import the header file of a class declared as a forward “@class”; • Downcasting values and pointers implicitly.
  42. Solutions
  43. Make your intentions explicit to the compiler
  44. •Make implicit protocols explicit •Create categories for private methods •Turn implicit type conversions and casts into explicit ones •Use @class in the @interface, #import on the @implementation
  45. http://kosmaczewski.net/2009/07/16/objective-c-compiler-warnings/
  46. 3
  47. Honor the Human Interface Guidelines
  48. http://developer.apple.com/ iphone/library/documentation/ userexperience/conceptual/ mobilehig/
  49. Your Objective:
  50. avoid rejections
  51. http://flyosity.com/application-design/iphone-application-design-patterns.php
  52. http://www.smashingmagazine.com/2009/07/21/ iphone-apps-design-mistakes-overblown-visuals/
  53. http://www.mobileorchard.com/avoiding-iphone-app-rejection-from-apple/
  54. http://www.apprejected.com/
  55. http://appreview.tumblr.com/
  56. http://kosmaczewski.net/2009/08/03/risk-management-in-iphone-projects/
  57. Your Objective:
  58. avoid this
  59. http://www.flickr.com/photos/gruber/2635257578/
  60. and this
  61. http://smokingapples.com/iphone/app-store-iphone/the-worst-twitter-client-ever/
  62. “ I can’t find one redeeming quality about this app. It’s slow to start [on a 3GS], doesn’t respond to taps while it’s trying to load other things, and crashes if you try to change modes a lot. It’s limited to only timeline, replies, and messages. It has no other functionality. Oh wait… I forgot its killer feature, you can have custom backgrounds and choose the color of your tweets. That totally makes up for its lack of useful features and sluggish performance. I’m not sure why someone would bother building such an inferior app other than that they wanted to find some suckers and score a quick buck. It seems even more insane to me that they’d be actively seeking out reviewers to cover this. I was given a promo code for ChillTwit, and even for free I didn’t want it on my phone. I was sad just from looking at screenshots. Actually seeing it running confirmed all of my fears. If it was a free app, I might forgive the developer, but the fact that he’s trying to get $0.99 out of people pisses me off to no end. Go buy Tweetie. If you somehow weren’t scared away by all my bitching and whinning, you can see ChillTwit on the app store here. But seriously, if you buy this, we’re not friends anymore.
  63. 4
  64. Thou shalt optimize for performance
  65. •Drawing and scrolling •Application launch •Files and data •Power and battery life
  66. Drawing and scrolling
  67. •UIView subclasses are already optimized •Custom views should use setNeedsDisplayInRect: whenever possible •Cache static objects
  68. •Use opaque views •Avoid allocating while scrolling •Reuse table cells •Collapse view hierarchies
  69. Application Launch
  70. •Design apps for quick launch and short use •Load data lazily •Load only images needed
  71. Files and Data
  72. •Use Core Data for large datasets •Avoid loading large files in memory •Use plist files for structured static data
  73. Power management
  74. •3G communications are expensive •Wi-Fi slightly cheaper •Send small chunks of data at low frequency •Prefer “chunky” to “chatty” protocols •Better performance == longer battery life
  75. 5
  76. Thou shalt test in the device
  77. http://blogs.tech-recipes.com/itouchmyiphone/2008/03/26/ from-iphone-sdk-to-simple-app-in-less-than-452-seconds/
  78. http://www.flickr.com/photos/edans/1526393678/
  79. •Camera http://www.flickr.com/photos/tensafefrogs/728581345/ •Accelerometer •GPS •Compass •Battery •Network •... Speed!
  80. http://www.flickr.com/photos/schill/969088410/
  81. http://www.flickr.com/photos/jaytamboli/3788327603/
  82. 6
  83. Remember your developer tools
  84. Shark
  85. Instruments
  86. 7
  87. Thou shalt use PNG files
  88. Portable Network Graphics (PNG) is a bitmapped image format that employs lossless data compression. PNG was created to improve upon and replace GIF (Graphics Interchange Format) as an image-file format not requiring a patent license. It is pronounced /ˈpɪŋ/ [1] or spelled out as P-N-G. The PNG acronym is optionally recursive, unofficially standing for “PNG's Not GIF”.[2] http://en.wikipedia.org/wiki/Portable_Network_Graphics
  89. Advantages
  90. Compression on build
  91. Low memory footprint
  92. Supported by all editors
  93. Quality
  94. http://en.wikipedia.org/wiki/File:Comparison_of_JPEG_and_PNG.png
  95. Transparency
  96. http://en.wikipedia.org/wiki/Portable_Network_Graphics
  97. •App icon: 57x57 “Icon.png” •Default image: 480x320 “Default.png” •Settings icon: 29x29 “Icon-Small.png”
  98. App Icon
  99. Design in maximum quality, then reduce
  100. Do not apply effects
  101. http://developer.apple.com/iphone/library/documentation/userexperience/conceptual/mobilehig/
  102. 512x512 72 DPI TIFF file for App Store
  103. 8
  104. Thou shalt use static analysis
  105. http://llvm.org/
  106. http://clang-analyzer.llvm.org/
  107. Source: Apple Documentation
  108. Source: Apple Documentation
  109. Source: Apple Documentation
  110. Source: Apple Documentation
  111. 9
  112. Thou shalt have project management hygiene
  113. •Project management •Human resource management •Developer working conditions •Prototypes •Quality management •Code organization
  114. http://kosmaczewski.net/2009/07/28/code-organization-in-xcode-projects/
  115. Your objective:
  116. avoid chaos
  117. http://www1.standishgroup.com/newsroom/chaos_2009.php
  118. http://www.geekonomicsbook.com/
  119. 10
  120. Thou shalt have fun!
  121. and
  122. be creative!
  123. Recap’
  124. 1. Manage memory properly 2. Remove compiler warnings 3. Read the Human Interface Guidelines 4. Optimize for performance 5. Test in the device
  125. 6. Know your developer tools 7. Use PNG files 8. Use static analysis 9. Have project management hygiene 10. Have fun and be creative!
  126. Thanks!
  127. Slides available in slideshare.net/akosma/presentations
  128. Questions?
SlideShare Zeitgeist 2009

+ Adrian KosmaczewskiAdrian Kosmaczewski Nominate

custom

875 views, 1 favs, 1 embeds more stats

More info about this document

© All Rights Reserved

Go to text version

  • Total Views 875
    • 858 on SlideShare
    • 17 from embeds
  • Comments 2
  • Favorites 1
  • Downloads 8
Most viewed embeds
  • 17 views on http://kosmaczewski.net

more

All embeds
  • 17 views on http://kosmaczewski.net

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories