File tree Expand file tree Collapse file tree 7 files changed +29
-8
lines changed Expand file tree Collapse file tree 7 files changed +29
-8
lines changed Original file line number Diff line number Diff line change 1
1
#Changelog
2
+ ## 8.9.1 (2025-08-20)
3
+ - 修复回调问题
4
+
2
5
## 8.9.0 (2025-06-12)
3
6
- 分片上传默认使用 V2 接口
4
7
Original file line number Diff line number Diff line change 1
1
Pod ::Spec . new do |s |
2
2
s . name = 'Qiniu'
3
- s . version = '8.9.0 '
3
+ s . version = '8.9.1 '
4
4
s . summary = 'Qiniu Resource Storage SDK for iOS and Mac'
5
5
s . homepage = 'https://github.com/qiniu/objc-sdk'
6
6
s . social_media_url = 'http://weibo.com/qiniutek'
Original file line number Diff line number Diff line change 14
14
15
15
@interface QNFormUpload ()
16
16
17
+ @property (nonatomic , strong )NSLock *locker;
17
18
@property (nonatomic , strong )QNUpProgress *progress;
18
-
19
19
@property (nonatomic , strong )QNRequestTransaction *uploadTransaction;
20
20
21
21
@end
22
22
23
23
@implementation QNFormUpload
24
24
25
+ - (void )initData {
26
+ [super initData ];
27
+
28
+ _locker = [[NSLock alloc ] init ];
29
+ }
30
+
25
31
- (void )startToUpload {
26
32
[super startToUpload ];
27
33
@@ -61,9 +67,11 @@ - (void)startToUpload {
61
67
}
62
68
63
69
- (QNUpProgress *)progress {
70
+ [self .locker lock ];
64
71
if (_progress == nil ) {
65
72
_progress = [QNUpProgress progress: self .option.progressHandler byteProgress: self .option.byteProgressHandler];
66
73
}
74
+ [self .locker unlock ];
67
75
return _progress;
68
76
}
69
77
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ - (instancetype)initWithSource:(id<QNUploadSource>)uploadSource
63
63
_config = config;
64
64
_recorder = config.recorder ;
65
65
_recorderKey = recorderKey;
66
-
66
+ _progressLocker = [[ NSLock alloc ] init ];
67
67
[self initData ];
68
68
}
69
69
return self;
@@ -100,10 +100,15 @@ - (void)notifyProgress:(BOOL)isCompleted {
100
100
return ;
101
101
}
102
102
103
+ QNUpProgress *progress = self.progress ;
104
+ if (progress == nil ) {
105
+ return ;
106
+ }
107
+
103
108
if (isCompleted) {
104
- [self . progress notifyDone: self .key totalBytes: [self .uploadInfo getSourceSize ]];
109
+ [progress notifyDone: self .key totalBytes: [self .uploadInfo getSourceSize ]];
105
110
} else {
106
- [self . progress progress: self .key uploadBytes: [self .uploadInfo uploadSize ] totalBytes: [self .uploadInfo getSourceSize ]];
111
+ [progress progress: self .key uploadBytes: [self .uploadInfo uploadSize ] totalBytes: [self .uploadInfo getSourceSize ]];
107
112
}
108
113
}
109
114
Original file line number Diff line number Diff line change 7
7
//
8
8
9
9
#import " QNAsyncRun.h"
10
+ #import " QNDefine.h"
10
11
#import " QNUpProgress.h"
11
12
12
13
@interface QNUpProgress ()
@@ -66,7 +67,9 @@ - (void)notify:(NSString *)key uploadBytes:(long long)uploadBytes totalBytes:(lo
66
67
}
67
68
68
69
if (self.byteProgress ) {
70
+ kQNWeakSelf ;
69
71
QNAsyncRunInMain (^{
72
+ kQNStrongSelf ;
70
73
self.byteProgress (key, uploadBytes, totalBytes);
71
74
});
72
75
return ;
@@ -77,7 +80,9 @@ - (void)notify:(NSString *)key uploadBytes:(long long)uploadBytes totalBytes:(lo
77
80
}
78
81
79
82
if (self.progress ) {
83
+ kQNWeakSelf ;
80
84
QNAsyncRunInMain (^{
85
+ kQNStrongSelf ;
81
86
double notifyPercent = (double ) uploadBytes / (double ) totalBytes;
82
87
self.progress (key, notifyPercent);
83
88
});
Original file line number Diff line number Diff line change 11
11
/* *
12
12
* sdk 版本
13
13
*/
14
- static NSString *const kQiniuVersion = @" 8.9.0 " ;
14
+ static NSString *const kQiniuVersion = @" 8.9.1 " ;
Original file line number Diff line number Diff line change 14
14
通过 CocoaPods
15
15
16
16
``` ruby
17
- pod " Qiniu" , " ~> 8.8 .1"
17
+ pod " Qiniu" , " ~> 8.9 .1"
18
18
```
19
19
20
20
通过 Swift Package Manager (Xcode 11+)
@@ -26,7 +26,7 @@ File -> Swift Packages -> Add Package Dependency,输入库链接,选择相
26
26
库对接:
27
27
let package = Package(
28
28
dependencies: [
29
- .package(url: "https://github.com/qiniu/objc-sdk", from: "8.9.0 ")
29
+ .package(url: "https://github.com/qiniu/objc-sdk", from: "8.9.1 ")
30
30
],
31
31
// ...
32
32
)
You can’t perform that action at this time.
0 commit comments