This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Synchronous Fetch | |
GCResponse *response = [GCChute findById:42]; | |
GCChute *chute = [response object]; | |
//Synchronous Request | |
if ([chute destroy]) { | |
//Destroyed | |
} | |
//Asynchronous Request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Synchronous Request | |
GCResponse *response = [GCChute searchMetaDataForKey:@"AnyKey" andValue:@"AnyValue"]; | |
for (GCChute *chute in [response object]) { | |
//Individual Chutes | |
NSLog(@"%@", chute); | |
} | |
//Asynchronous Request | |
[GCChute searchMetaDataForKey:@"AnyKey" andValue:@"AnyValue" inBackgroundWithCompletion:^(GCResponse *response) { | |
for (GCChute *chute in [response object]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GCResponse *response = [GCChute findById:29]; | |
GCChute *chute = [response object]; | |
[chute setName:@"NewName"]; | |
//Synchronous Request | |
if ([chute update]) { | |
//Updated | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Synchronous Request | |
GCResponse *response = [GCChute findById:42]; | |
GCChute *chute = [response object]; | |
//Asynchronous Request | |
[GCChute findById:42 inBackgroundWithCompletion:^(GCResponse *response) { | |
GCChute *chute = [response object]; | |
}]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Synchronous Request | |
GCResponse *_response = [GCChute all]; | |
for (GCChute *chute in [_response object]) { | |
//Individual Chutes | |
NSLog(@"%@", chute); | |
} | |
//Asynchronous Request | |
[GCChute allInBackgroundWithCompletion:^(GCResponse *response) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GCChute *_newChute = [GCChute new]; | |
[_newChute setName:@"Hello World"]; | |
//Set Permissions for a Chute | |
[_newChute setPermissionView:GCPermissionTypePublic]; | |
[_newChute setPermissionAddMembers:GCPermissionTypePublic]; | |
[_newChute setPermissionAddPhotos:GCPermissionTypePublic]; | |
[_newChute setPermissionAddComments:GCPermissionTypePublic]; | |
[_newChute setModeratePhotos:GCPermissionTypePublic]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *_path = [[NSString alloc] init]; | |
NSDictionary *_params = [[NSDictionary alloc] init]; | |
GCRequest *gcRequest = [[GCRequest alloc] init]; | |
//Synchronous Request | |
GCResponse *_response = [[gcRequest deleteRequestWithPath:_path andParams:_params] retain]; | |
//Asynchronous request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *_path = [[NSString alloc] init]; | |
NSDictionary *_params = [[NSDictionary alloc] init]; | |
GCRequest *gcRequest = [[GCRequest alloc] init]; | |
//Synchronous Request | |
GCResponse *_response = [[gcRequest putRequestWithPath:_path andParams:_params] retain]; | |
//Asynchronous request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *_path = [[NSString alloc] init]; | |
NSDictionary *_params = [[NSDictionary alloc] init]; | |
GCRequest *gcRequest = [[GCRequest alloc] init]; | |
//Synchronous Request | |
GCResponse *_response = [[gcRequest postRequestWithPath:_path andParams:_params] retain]; | |
//Asynchronous request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *_path = [[NSString alloc] init]; | |
GCRequest *gcRequest = [[GCRequest alloc] init]; | |
//Synchronous Request | |
GCResponse *_response = [[gcRequest getRequestWithPath:_path] retain]; | |
//Asynchronous request | |
[gcRequest getRequestInBackgroundWithPath:_path withResponse:^(GCResponse *response) { | |
NSLog(@"%@", response); |