Skip to content

Commit 7aaa17e

Browse files
直接使用 weak 关键字,不支持 5.0 之前版本了
1 parent fec8d8f commit 7aaa17e

File tree

7 files changed

+23
-27
lines changed

7 files changed

+23
-27
lines changed

Demo-MAC/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
platform :osx, 10.6
1+
platform :osx, 10.7
22
target 'LKDB-Demo' do
33
pod 'LKDBHelper', :path => '../'
44
end

Demo-iOS/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
platform :ios,4.3
1+
platform :ios,5.0
22
target 'iOS-Demo' do
33
pod 'LKDBHelper', :path => '../'
44
end

Demo-iOS/Podfile.lock

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
PODS:
2-
- FMDB (2.6.2):
3-
- FMDB/standard (= 2.6.2)
4-
- FMDB/standard (2.6.2)
5-
- LKDBHelper (2.4.2):
2+
- FMDB (2.7.2):
3+
- FMDB/standard (= 2.7.2)
4+
- FMDB/standard (2.7.2)
5+
- LKDBHelper (2.4.7):
6+
- LKDBHelper/standard (= 2.4.7)
7+
- LKDBHelper/standard (2.4.7):
68
- FMDB
79

810
DEPENDENCIES:
911
- LKDBHelper (from `../`)
1012

1113
EXTERNAL SOURCES:
1214
LKDBHelper:
13-
:path: ../
15+
:path: "../"
1416

1517
SPEC CHECKSUMS:
16-
FMDB: 854a0341b4726e53276f2a8996f06f1b80f9259a
17-
LKDBHelper: ab67373b32f47463bf5f838d730f225824f4492a
18+
FMDB: 6198a90e7b6900cfc046e6bc0ef6ebb7be9236aa
19+
LKDBHelper: a6c63147491654da18f72212f80d67db3a27289c
1820

19-
PODFILE CHECKSUM: fc4bc4781b371bfd5b721f772757085a673d5280
21+
PODFILE CHECKSUM: 8ab4fcb50ca555a64e4a5b32b3d09ca09c6105ce
2022

21-
COCOAPODS: 1.1.1
23+
COCOAPODS: 1.2.1

Demo-iOS/iOS-Demo.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
);
185185
runOnlyForDeploymentPostprocessing = 0;
186186
shellPath = /bin/sh;
187-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
187+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
188188
showEnvVarsInLog = 0;
189189
};
190190
3BCEDBAA4CAFC23624D9C6CD /* [CP] Copy Pods Resources */ = {

LKDBHelper.podspec.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "LKDBHelper",
3-
"version": "2.4.6",
3+
"version": "2.4.7",
44
"summary": "全自动的插入,查询,更新,删除, an automatic database operation thread-safe and not afraid of recursive deadlock",
55
"description": "全面支持 NSArray,NSDictionary, ModelClass, NSNumber, NSString, NSDate, NSData, UIColor, UIImage, CGRect, CGPoint, CGSize, NSRange, int,char,float, double, long.. 等属性的自动化操作(插入和查询)",
66
"homepage": "https://github.com/li6185377/LKDBHelper-SQLite-ORM",
@@ -10,11 +10,11 @@
1010
},
1111
"source": {
1212
"git": "https://github.com/li6185377/LKDBHelper-SQLite-ORM.git",
13-
"tag": "2.4.6"
13+
"tag": "2.4.7"
1414
},
1515
"platforms": {
16-
"ios": "4.3",
17-
"osx": "10.6"
16+
"ios": "5.0",
17+
"osx": "10.7"
1818
},
1919

2020
"requires_arc": true,

LKDBHelper/Helper/LKDBHelper.m

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
}
2323

2424
#define LKDBCode_Async_Begin \
25-
__LKDBWeak LKDBHelper *wself = self; \
25+
__weak LKDBHelper *wself = self; \
2626
[self asyncBlock :^{__strong LKDBHelper *sself = wself; \
2727
if (sself) {
2828

@@ -50,11 +50,11 @@ - (void)setDb_inserting:(BOOL)db_inserting;
5050
@end
5151

5252
@interface LKDBWeakObject : NSObject
53-
@property (nonatomic, LKDBWeak) LKDBHelper *obj;
53+
@property (nonatomic, weak) LKDBHelper *obj;
5454
@end
5555

5656
@interface LKDBHelper ()
57-
@property (nonatomic, LKDBWeak) FMDatabase *usingdb;
57+
@property (nonatomic, weak) FMDatabase *usingdb;
5858
@property (nonatomic, strong) FMDatabaseQueue *bindingQueue;
5959
@property (nonatomic, copy) NSString *dbPath;
6060
@property (nonatomic, strong) NSMutableArray *createdTableNames;
@@ -320,7 +320,9 @@ - (void)setAutoCloseDBTime:(NSInteger)time {
320320

321321
- (void)startAutoCloseTimer {
322322
self.runingAutoCloseTimer = YES;
323+
__weak LKDBHelper *wself = self;
323324
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(self.autoCloseDBDelayTime * NSEC_PER_SEC)), dispatch_get_global_queue(0, 0), ^{
325+
__strong LKDBHelper *self = wself;
324326
[self.threadLock lock];
325327
self.runingAutoCloseTimer = NO;
326328
BOOL hasClosed = [self autoCloseDBConnection];

LKDBHelper/Helper/LKDBUtils.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@ NS_ASSUME_NONNULL_BEGIN
4949
#define LKErrorLog(...)
5050
#endif
5151

52-
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_5_0 || __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_7
53-
#define LKDBWeak weak
54-
#define __LKDBWeak __weak
55-
#else
56-
#define LKDBWeak unsafe_unretained
57-
#define __LKDBWeak
58-
#endif
59-
6052
static NSString *const LKSQL_Type_Text = @"text";
6153
static NSString *const LKSQL_Type_Int = @"integer";
6254
static NSString *const LKSQL_Type_Double = @"double";

0 commit comments

Comments
 (0)