Run Loop Sequence of Events

  1. Notify observers that the run loop has been entered.
  2. Notify observers that any ready timers are about to fire.
  3. Notify observers that any input sources that are not port based are about to fire.
  4. Fire any non-port-based input sources that are ready to fire.
  5. If a port-based input source is ready and waiting to fire, process the event immediately. Go to step 9.
  6. Notify observers that the thread is about to sleep.
  7. Put the thread to sleep until one of the following events occurs: An event arrives for a port-based input source. A timer fires. The timeout value set for the run loop expires. The run loop is explicitly woken up.
  8. Notify observers that the thread just woke up.
  9. Process the pending event. If a user-defined timer fired, process the timer event and restart the loop. Go to step 2. If an input source fired, deliver the event. If the run loop was explicitly woken up but has not yet timed out, restart the loop. Go to step 2.
  10. Notify observers that the run loop has exited.


显示 MacOS 隐藏文件


defaults write AppleShowAllFiles -bool true


defaults write AppleShowAllFiles -bool false

iOS SizeClass

Alt none

Android Studio Make Jar

task clearJar(type: Delete) {
    delete 'build/outputs/jar/something-release.jar'

task makeJar(type: Copy) {
    rename('classes.jar', 'something-release.jar')
makeJar.dependsOn(clearJar, build)

iOS Max Memory Budget

    iPad1: 127MB/256MB/49% (crash amount/total amount/percentage of total)
    iPad2: 275MB/512MB/53%
    iPad3: 645MB/1024MB/62%
    iPad4: 585MB/1024MB/57% (iOS 8.1)
    iPad Mini 1st Generation: 297MB/512MB/58%
    iPad Mini retina: 696MB/1024MB/68% (iOS 7.1)
    iPad Air: 697MB/1024MB/68%
    iPad Air 2: 1195MB/2048MB/58%
    iPod touch 4th gen: 130MB/256MB/51% (iOS 6.1.1)
    iPod touch 5th gen: 286MB/512MB/56% (iOS 7.0)
    iPhone4: 325MB/512MB/63%
    iPhone5: 645MB/1024MB/62%
    iPhone5S: 646MB/1024MB/63%
    iPhone6: 645MB/1024MB/62%
    iPhone6+: 645MB/1024MB/62%
    iPhone6s: 1396MB/2048MB/68% (iOS 9.2)
    iPhone6s+: 1195MB/2048MB/58%