quattro_4 scribble

scribble 落書き (調べた事をただ落書きする)

NSScreencast Episode #103 Refactoring View Controllers - Part 2

Refactoring View Controllers - Part 2 - NSScreencast

Twitterのフォロワーを一覧するアプリのリファクタリング続き

  • refactoring -> simple view did load
  • introduce concept of model
    • TwitterFollower.m
      • initWithDictionary
  • map operation
    • create new group Support on XCode
    • category nsarray
      • NSArray+FKBMap.h
        • @interface NSArray (FKBMap)
    • prefix method
      • fkb_map:(id (^)(id inputItem))transformBlock;
        • ugly
      • apple may introduce in the future
    • fkb_map
      • [NSMutableArray arrayWithCapacity:self.count];
      • return [NSArray arrayWithArray:newArray];
  • objc.io Lighter View Controllers - Lighter View Controllers - objc.io issue #1
    • array data source
      • configure cell block
        • tableView cellForRowAtIndexPath
        • configureCellBlock(cell,item);
      • viewDidLoad
        • [self setupDatasource];
      • setupDatasource
        • [cell configureForFollower:follower];
        • self.tableView.dataSource = self.dataSource;
  • cell part
    • refactoring ×
      • GC issue?
    • create category for cell
      • TwitterUserCell+TwitterFollower.m
      • configureForFollower:(TwitterFollower *)follower
  • UITableViewCell Is Not a Controller