OlapicCategoryHandler Class Reference
| Inherits from | OlapicHandler : NSObject |
| Declared in | OlapicCategoryHandler.h |
Instance Methods
getCategoryByID:onSuccess:onFailure:
Get a category entity by its ID
- (void)getCategoryByID:(NSString *)ID onSuccess:(void ( ^ ) ( OlapicCategoryEntity *category ))success onFailure:(void ( ^ ) ( NSError *error ))failureParameters
- ID
The ID of the category
- success
A callback block for when the category is successfully retrieved
- failure
A callback block for when the SDK can’t get the category
Availability
v1.0
Discussion
Example:
[[[OlapicSDK sharedOlapicSDK] categories] getCategoryByID:@"001"
onSuccess:^(OlapicCategoryEntity *category){
label.text = [category get:@"name"];
}
onFailure:^(NSError *error){
NSLog(@"Error: %@",error.description);
}];
Declared In
OlapicCategoryHandler.hgetCategoryByTagKey:onSuccess:onFailure:
Get a category entity by its tag_key property
- (void)getCategoryByTagKey:(NSString *)tag onSuccess:(void ( ^ ) ( OlapicCategoryEntity *category ))success onFailure:(void ( ^ ) ( NSError *error ))failureParameters
- tag
The value of the tag_key property
- success
A callback block for when the category is successfully retrieved
- failure
A callback block for when the SDK can’t get the category
Availability
v1.0
Discussion
Example:
[[[OlapicSDK sharedOlapicSDK] categories] getCategoryByTagKey:@"my_tag"
onSuccess:^(OlapicCategoryEntity *category){
label.text = [category get:@"name"];
}
onFailure:^(NSError *error){
NSLog(@"Error: %@",error.description);
}];
Declared In
OlapicCategoryHandler.hgetCategoryFromURL:onSuccess:onFailure:
Get a category entity from the API URL
- (void)getCategoryFromURL:(NSString *)URL onSuccess:(void ( ^ ) ( OlapicCategoryEntity *category ))success onFailure:(void ( ^ ) ( NSError *error ))failureParameters
- URL
The URL for the category
- success
A callback block for when the category is successfully retrieved
- failure
A callback block for when the SDK can’t get the category
Availability
v1.0
Discussion
Example:
[[[OlapicSDK sharedOlapicSDK] categories] getCategoryFromURL:@"categories/001"
onSuccess:^(OlapicCategoryEntity *category){
label.text = [category get:@"name"];
}
onFailure:^(NSError *error){
NSLog(@"Error: %@",error.description);
}];
Declared In
OlapicCategoryHandler.hgetCategoryFromURL:onSuccess:onFailure:parameters:
Get a category entity from an API URL with extra parameters
- (void)getCategoryFromURL:(NSString *)URL onSuccess:(void ( ^ ) ( OlapicCategoryEntity *category ))success onFailure:(void ( ^ ) ( NSError *error ))failure parameters:(NSDictionary *)parametersParameters
- URL
the API URL
- success
A callback block for when the category is successfully retrieved
- failure
A callback block for when the SDK can’t get the category
- parameters
A list of parameters for the request, like ‘count’ or ‘limit’
Availability
v1.0
Discussion
Example:
[[[OlapicSDK sharedOlapicSDK] categories] getCategoryFromURL:@"categories/001"
onSuccess:^(OlapicCategoryEntity *category){
label.text = [category get:@"name"];
}
onFailure:^(NSError *error){
NSLog(@"Error: %@",error.description);
}
parameters:nil];
Declared In
OlapicCategoryHandler.h