ios - Definition of dispatch_queue_t as strong -
i saw next line:
@property (nonatomic, strong) dispatch_queue_t filtermainqueue;
why declared instance of dispatch_queue_t, not object, strong?
this totally practice. want notice since os x mount lion , ios 6.0 gcd , xpc objects in ios/ os x runtimes now treated objective-c objects arc
, not primitives memory-managed same way usual objective-c objects. that's why should declare them strong
.
you can check in object.h
:
#define dispatch_decl(name) os_object_decl_subclass(name, dispatch_object)
this fact stated in docs: ios 6 , later—dispatch objects (including queues) objective-c objects, , retained , released automatically. os x 10.8 , later—dispatch objects (including queues) objective-c objects, , retained , released automatically. before versions—dispatch objects custom objects. must handle reference counting manually
, comments in object.h
:
* default, dispatch objects declared objective-c types when building * objective-c compiler. allows them participate in arc, in rr * management blocks runtime , in leaks checking static * analyzer, , enables them added cocoa collections. * see <os/object.h> details.
ios objective-c multithreading
No comments:
Post a Comment