Tuya iOS Smart Life App SDK 5.15.0
ThingSmartWeakProxy Class Reference

#import <ThingSmartWeakProxy.h>

Inheritance diagram for ThingSmartWeakProxy:

Instance Methods

(instancetype) - initWithTarget:
 
(instancetype) - initWithTarget:
 
(instancetype) - initWithTarget:
 
(instancetype) - initWithTarget:
 

Class Methods

(instancetype) + proxyWithTarget:
 
(instancetype) + proxyWithTarget:
 
(instancetype) + proxyWithTarget:
 
(instancetype) + proxyWithTarget:
 

Properties

id target
 

Detailed Description

A proxy used to hold a weak object. It can be used to avoid retain cycles, such as the target in NSTimer or CADisplayLink.

sample code:

@implementation MyView { NSTimer *_timer; }

  • (void)initTimer { ThingSmartWeakProxy *proxy = [ThingSmartWeakProxy proxyWithTarget:self]; _timer = [NSTimer timerWithTimeInterval:0.1 target:proxy selector:@selector(tick:) userInfo:nil repeats:YES]; }
  • (void)tick:(NSTimer *)timer {...} @end

Definition at line 29 of file ThingSmartWeakProxy.h.

Method Documentation

◆ initWithTarget: [1/4]

- (instancetype) initWithTarget: (id)  target

Creates a new weak proxy for target.

Parameters
targetTarget object.
Returns
A new proxy object.

◆ initWithTarget: [2/4]

- (instancetype) initWithTarget: (id)  target

Creates a new weak proxy for target.

Parameters
targetTarget object.
Returns
A new proxy object.

◆ initWithTarget: [3/4]

- (instancetype) initWithTarget: (id)  target

Creates a new weak proxy for target.

Parameters
targetTarget object.
Returns
A new proxy object.

◆ initWithTarget: [4/4]

- (instancetype) initWithTarget: (id)  target

Creates a new weak proxy for target.

Parameters
targetTarget object.
Returns
A new proxy object.

◆ proxyWithTarget: [1/4]

+ (instancetype) proxyWithTarget: (id)  target

Creates a new weak proxy for target.

Parameters
targetTarget object.
Returns
A new proxy object.

◆ proxyWithTarget: [2/4]

+ (instancetype) proxyWithTarget: (id)  target

Creates a new weak proxy for target.

Parameters
targetTarget object.
Returns
A new proxy object.

◆ proxyWithTarget: [3/4]

+ (instancetype) proxyWithTarget: (id)  target

Creates a new weak proxy for target.

Parameters
targetTarget object.
Returns
A new proxy object.

◆ proxyWithTarget: [4/4]

+ (instancetype) proxyWithTarget: (id)  target

Creates a new weak proxy for target.

Parameters
targetTarget object.
Returns
A new proxy object.

Property Documentation

◆ target

- (id) target
readnonatomicweak

The proxy target.

Definition at line 34 of file ThingSmartWeakProxy.h.


The documentation for this class was generated from the following files: