LoginSignup
16
15

More than 5 years have passed since last update.

Swift で @autoreleasepool どうやるの?

Last updated at Posted at 2014-06-17

autoreleasepool { } だそうです。

こんな感じで使うようです。

for i in 1...10000 {
  autoreleasepool {
    // do heavy work
  }
}

iOS - ARC のメモリ解放タイミングを調べた は Swift でも有効なようで。

http://swift-lang.org/tryswift/ で試してみたら "unexpected token: autoreleasepool" で怒られた。。。Xcode6 を入れないと動かせないんですかね。

16
15
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
15