タグ

関連タグで絞り込む (0)

  • 関連タグはありません

タグの絞り込みを解除

CocoaとNSOperationに関するrabbit2goのブックマーク (3)

  • Cocoa Is My Girlfriend ≫ Blog Archive ≫ NSOperation Example

    Forget Mandelbrot sets (Apple coding headstarts) and Expression Trees. NSOperation is really not that hard. In his post, Marcus introduced how to use NSOperation to greatly simplify multi-threading tasks in your application. I am now going to provide a step-by-step walk-through sample application that uses NSOperation, NSOperationQueue, and QTKit. While looking around the Internet, I noticed that

  • 無為空間 |NSOperationQueueとスレッドの関係

    無為空間 むいむい(´ω`*) Entries NSOperationQueueとスレッドの関係 タグ: Objective-C Mac NSOperation NSOperationQueueを使ったプログラムをデバッグしていてふと気付いたのだが、NSOperationQueueは何もクソ真面目に「concurrentではない全てのoperationのために毎回スレッドを作っている」わけではないらしい。 例えば以下のコード。 @interface Operation : NSOperation { int number; } @property (nonatomic) int number; @end @implementation Operation @synthesize number; - (void)main { [NSThread sleepForTimeInterval:1]

  • NSOperationによるバックグラウンド処理 - Objective-Audio

    NSOperationってCoreAnimationみたいな派手な機能と違って、あまり解説されていない気がするので、使い方を書いておきます。オーディオのアプリケーションでも、読み込んだオーディオファイルの波形の画像をバックグラウンドで作っておいて、出来上がったら表示するみたいな事にも使えると思いますので。(※2008/5/12 記事にNSInvocationOperation等いろいろ修正を加えています。GCなしにも対応のはず。) NSOperationを使う NSOperationのサブクラスのmainメソッドにバックグラウンドで行いたい処理を記述しておき、そのインスタンス(以後、オペレーション)を作成して、NSOperationQueueのインスタンス(以後、キュー)のaddOperationメソッドに渡すと、あとは勝手にバックグラウンドで処理してくれます。キューへ渡した後にオペレーシ

  • 1