What is the correct way to release a GCD dispatch queue property?

后端 未结 4 932
耶瑟儿~
耶瑟儿~ 2021-02-18 19:18

I\'m using a dispatch_queue which is accessed through a property of its owner, like this:

@property (nonatomic, assign) dispatch_queue_t queue;

4条回答
  •  灰色年华
    2021-02-18 19:48

    setup your property like so:

    @property (readwrite, strong, nonatomic) __attribute__((NSObject)) dispatch_queue_t queue;
    

    Assign is implied and Strong will retain the queue telling ARC to treat it as an NSObject.

提交回复
热议问题