[fwd] some quick notes with relevant references of ios development

从我一直关注的一位朋友的blog上抓来. 素未谋面, 但是分享的态度还是依旧.  我的感触是,  ios开发  测试驱动 单元测试这些在国外的团队里被应用的很好. 与其担心时间不足,还真不如分配一些代码测试的时间. 这是个趋势. 换句话说是科学.

@tinyfool 不知道你家团队是否也是理念先进.

Original uRL:   What I learned from my first iOS job in Australia from chris. vinshine(@cocoachina?)

Objective-C / Cocoa:

  1. Use weak reference in block to avoid retain cycle (http://blog.random-ideas.net/?p=160)
  2. Use [UIImage resizableImageWithCapInsets] to create stretchable background image (http://stackoverflow.com/questions/8671315/using-resizableimagewithcapinsets-image-for-button-only-works-for-the-state-set)
  3. If an abstract class has a tempate method for its subclasses to override, it’s a good practise to raise exception in the abstract implementation in case subclasses don’t override this method and parent implementation gets called
  4. in LLDB debugger, use “po [[UIApp keyWindow] recursiveDescription]” to output app view hierarchy
  5. Use NSNib to speed up tablview cell loading (http://useyourloaf.com/blog/2011/02/28/speeding-up-table-view-cell-loading-with-uinib.html)
  6. You can use -[NSArray indexOfObject:inSortedRange:options:usingComparator:] to ask an NSArray for the index where an object should be inserted given an array range that’s currently sorted (http://stackoverflow.com/questions/8180115/nsmutablearray-add-object-with-order)
  7. using view.bounds for size, not view.frame, sometimes view.frame doesn’t reflect the current  device orientation (http://stackoverflow.com/questions/5194504/reporting-incorrect-bounds-in-landscape-mode)

Tools:

  1. continus integration with Jenkins (http://jenkins-ci.org/)
  2. Use POSTMAN (a Chrome plugin) to observer RESTful api response (https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm?hl=en)
  3. AppCode, an alternative to Xcode (http://www.jetbrains.com/objc/)
  4. Use Charles to observe RESTful api response, set breakpoint, mock/modify HTTP response content(http://www.charlesproxy.com/)
  5. Use XScope to measure pointed size in simulator and Photoshop (http://iconfactory.com/software/xscope)
  6. Jira, an Agile project managment & issue tracking web tool (http://www.atlassian.com/software/jira/overview)
  7. Use multiple targets in CocoaPods Podfile (https://github.com/CocoaPods/CocoaPods/wiki/A-Podfile)
  8. Use your own podspec file to integrate private libraries (http://theonlylars.com/blog/2013/01/20/cocoapods-creating-a-pod-spec/)

Testing:

  1. TDD with GHUnit (https://github.com/gabriel/gh-unit)
  2. Test data mock and stub with OCMock (http://ocmock.org/)
  3. BDD with Kiwi (https://github.com/allending/Kiwi)
  4. Automation Test with Jasmin (http://pivotal.github.com/jasmine/)
Leave a comment

0 Comments.

Leave a Reply


[ Ctrl + Enter ]

click to change验证码

无觅相关文章插件