Skip to content

Commit 8b7770f

Browse files
committed
There is a Task API in beta which causes a naming conflict.
1 parent b054826 commit 8b7770f

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Templates/ObjC/Requests/EntityCollectionRequest.m.tt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ if (innerEntityType.Equals(propName))
4848
- (<#=writer.GetStaticCodePrefix()#>URLSessionDataTask *)getWithCompletion:(<#=propName+ collectionNamer#>CompletionHandler)completionHandler
4949
{
5050

51-
<#=writer.GetStaticCodePrefix()#>URLSessionDataTask * task = [self collectionTaskWithRequest:[self get]
51+
<#=writer.GetStaticCodePrefix()#>URLSessionDataTask * sessionDataTask = [self collectionTaskWithRequest:[self get]
5252
odObjectWithDictionary:^(id response){
5353
<#
5454
if (prop.IsSystem())
@@ -74,8 +74,8 @@ if (innerEntityType.Equals(propName))
7474
completionHandler(collectionResponse, nil, error);
7575
}
7676
}];
77-
[task execute];
78-
return task;
77+
[sessionDataTask execute];
78+
return sessionDataTask;
7979
}
8080

8181
<#

Templates/ObjC/Requests/EntityRequest.m.tt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ var entityName = writer.GetPrefix() + entity.Name.ToUpperFirstChar() + (withRefe
4040

4141
- (<#=writer.GetStaticCodePrefix()#>URLSessionDataTask *)getWithCompletion:<#=writer.GetNetworkCompletionBlock(writer.GetPrefix() + entity.Name.ToUpperFirstChar(), "response")#>completionHandler
4242
{
43-
<#=writer.GetStaticCodePrefix()#>URLSessionDataTask *task = [self taskWithRequest:[self get]
43+
<#=writer.GetStaticCodePrefix()#>URLSessionDataTask *sessionDataTask = [self taskWithRequest:[self get]
4444
odObjectWithDictionary:^(NSDictionary *response){
4545
return [[<#=writer.GetPrefix() + entity.Name.ToUpperFirstChar()#> alloc] initWithDictionary:response];
4646
}
4747
completion:completionHandler];
48-
[task execute];
49-
return task;
48+
[sessionDataTask execute];
49+
return sessionDataTask;
5050
}
5151

5252
<# } #>
@@ -63,13 +63,13 @@ var entityName = writer.GetPrefix() + entity.Name.ToUpperFirstChar() + (withRefe
6363

6464
- (<#=writer.GetStaticCodePrefix()#>URLSessionDataTask *)update:(<#=writer.GetPrefix() + entity.Name.ToUpperFirstChar()#> *)<#=entity.Name#> withCompletion:<#=writer.GetNetworkCompletionBlock(writer.GetPrefix() + entity.Name.ToUpperFirstChar(), "response")#>completionHandler
6565
{
66-
<#=writer.GetStaticCodePrefix()#>URLSessionDataTask *task = [self taskWithRequest:[self update:<#=entity.Name#>]
66+
<#=writer.GetStaticCodePrefix()#>URLSessionDataTask *sessionDataTask = [self taskWithRequest:[self update:<#=entity.Name#>]
6767
odObjectWithDictionary:^(NSDictionary *response){
6868
return [[<#=writer.GetPrefix() + entity.Name.ToUpperFirstChar()#> alloc] initWithDictionary:response];
6969
}
7070
completion:completionHandler];
71-
[task execute];
72-
return task;
71+
[sessionDataTask execute];
72+
return sessionDataTask;
7373
}
7474

7575
<# } #>
@@ -85,11 +85,11 @@ var entityName = writer.GetPrefix() + entity.Name.ToUpperFirstChar() + (withRefe
8585

8686
- (<#=writer.GetStaticCodePrefix()#>URLSessionDataTask *)deleteWithCompletion:<#=writer.GetNetworkCompletionBlock(null, null)#>completionHandler
8787
{
88-
<#=writer.GetStaticCodePrefix()#>URLSessionDataTask *task = [self taskWithRequest:[self delete] completion:^(NSDictionary *response, NSError *error){
88+
<#=writer.GetStaticCodePrefix()#>URLSessionDataTask *sessionDataTask = [self taskWithRequest:[self delete] completion:^(NSDictionary *response, NSError *error){
8989
completionHandler(error);
9090
}];
91-
[task execute];
92-
return task;
91+
[sessionDataTask execute];
92+
return sessionDataTask;
9393
}
9494

9595
<# } #>

0 commit comments

Comments
 (0)