File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -7,20 +7,26 @@ @implementation MLModel (Compat)
7
7
8
8
- (void ) predictionFromFeatures : (id <MLFeatureProvider>) input
9
9
completionHandler : (void (^)(id <MLFeatureProvider> output, NSError * error)) completionHandler {
10
- [NSOperationQueue .mainQueue addOperationWithBlock: ^{
10
+ [NSOperationQueue .new addOperationWithBlock: ^{
11
11
NSError *error = nil ;
12
12
id <MLFeatureProvider> prediction = [self predictionFromFeatures: input error: &error];
13
- completionHandler (prediction, error);
13
+
14
+ [NSOperationQueue .mainQueue addOperationWithBlock: ^{
15
+ completionHandler (prediction, error);
16
+ }];
14
17
}];
15
18
}
16
19
17
20
- (void ) predictionFromFeatures : (id <MLFeatureProvider>) input
18
21
options : (MLPredictionOptions *) options
19
22
completionHandler : (void (^)(id <MLFeatureProvider> output, NSError * error)) completionHandler {
20
- [NSOperationQueue .mainQueue addOperationWithBlock: ^{
23
+ [NSOperationQueue .new addOperationWithBlock: ^{
21
24
NSError *error = nil ;
22
25
id <MLFeatureProvider> prediction = [self predictionFromFeatures: input options: options error: &error];
23
- completionHandler (prediction, error);
26
+
27
+ [NSOperationQueue .mainQueue addOperationWithBlock: ^{
28
+ completionHandler (prediction, error);
29
+ }];
24
30
}];
25
31
}
26
32
You can’t perform that action at this time.
0 commit comments