hch
2025-07-18 2a011653190c36e6fb1f790b3819a1d6b0744aef
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
//  TTInstallBaseMacro.h
//  Article
//
//  Created by panxiang on 15/11/5.
//
//
 
#ifndef TTInstallBaseMacro_h
#define TTInstallBaseMacro_h
 
#define WeakSelf __weak typeof(self) wself = self
#define StrongSelf __strong typeof(wself) self = wself
 
#ifdef DEBUG
 
#define TTInstallLOGD( s, ... ) NSLog(@"Debug %s: %@", __FUNCTION__, [NSString stringWithFormat:(s), ##__VA_ARGS__])
 
#define TTInstallLOGT( s, ... ) NSLog(@"Trace %s: %@", __FUNCTION__, [NSString stringWithFormat:(s), ##__VA_ARGS__])
 
#define TTInstallTICK  NSDate *startTime = [NSDate date]
#define TTInstallTOCK  LOGD(@"took time: %f seconds.", -[startTime timeIntervalSinceNow])
 
#else
 
#define TTInstallLOGD( s, ... )
#define TTInstallLOGT( s, ... )
#define TTInstallTICK
#define TTInstallTOCK
 
#endif
 
 
#ifndef TTInstallIsEmptyString
#define TTInstallIsEmptyString(str) (!str || ![str isKindOfClass:[NSString class]] || str.length == 0)
#endif
 
#ifndef TTInstallIsEmptyArray
#define TTInstallIsEmptyArray(array) (!array || ![array isKindOfClass:[NSArray class]] || array.count == 0)
#endif
 
#ifndef TTInstallIsEmptyDictionary
#define TTInstallIsEmptyDictionary(dict) (!dict || ![dict isKindOfClass:[NSDictionary class]] || ((NSDictionary *)dict).count == 0)
#endif
 
#endif /* TTInstallBaseMacro_h */