quattro_4 scribble

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

NSScreencast Episode #92 Background Fetch

Background Fetch - NSScreencast

Weather appでlocationからの検索をバックグラウンドを使って実行

  • weather app
    • search by location
  • WeatherFetcher
    • sharedInstance
    • cachedResult
  • needsRefresh
    • NSTimeInterval interval = abs([lastUpdated timeIntervalSinceNow]);
    • timePassed
  • application capability
    • background fetch
  • app delegate
    • [application setMinimumBackgroundFetchInterval:UIApplicationBackgroundFetchIntervalMinimum];
      • UIApplicationBackgroundFetchIntervalMinimum
      • UIApplicationBackgroundFetchIntervalNever
    • performFetchWithCompletionHandler
      • cachedResult
  • testing
    • breakponit with sound
    • duplicate scheme
      • check background fetching
  • fetch twice problem
    • not reload data in background
      • applicationState] == UIApplicationStateActive
  • problem value not refreshed on next view loading
    • [NSNotificationCenter defaultCenter] postNotificationName:@"WeatherUpdated"
    • in viewDidLoad
      • [NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onBackgroundUpdate:) name:@"WeatherUpdated"
      • onBackgroundUpdate
    • snapshot has new data
    • applicationDidBecomeActive