5

[NSThread currentThread] の戻り値の意味を誰か説明してもらえますか?

NSLog

NSLog(@"%@", [NSThread currentThread]);

結果

<NSThread: 0x1e04ed60>{name = (null), num = 5}

以下は何ですか?

  1. "NSThread: 0x1e04ed60"
  2. 名前 = (ヌル)
  3. 数 = 5

num = 5 は、Xcode にリストされているスレッド番号とは何の関係もありません (NSOperationQueue で複数のスレッドを実行しているため、このインスタンスのスレッド 9 を示しています)。

Apple Doc からの説明はかなり役に立ちません。戻り値 現在の実行スレッドを表すスレッド オブジェクト。 https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSThread_Class/Reference/Reference.html

ありがとうございました!

4

1 に答える 1