Could anyone please explain the meaning of the returned value of [NSThread currentThread]?
NSLog
NSLog(@"%@", [NSThread currentThread]);
Result
<NSThread: 0x1e04ed60>{name = (null), num = 5}
What are the following?
- "NSThread: 0x1e04ed60"
- name = (null)
- num = 5
num = 5 doesn't have anything to do with the Thread number listed in the Xcode (which it shows Thread 9 for this instance, since I'm running multiple threads with NSOperationQueue)
the explanation from apple doc is pretty useless, Return Value A thread object representing the current thread of execution. https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSThread_Class/Reference/Reference.html
Thank you!
The first is the memory address. The second is the thread name. You can set the name of a thread. The third number can be explained in these posts:
See:
po [NSThread currentThread]
and
NSThread number on iOS?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With