Inherits from OlapicHandler : NSObject
Declared in OlapicCategoryHandler.h

Overview

The object in charge of creating and managing the OlapicCategoryEntities

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 ))failure

Parameters

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.h

getCategoryByTagKey:onSuccess:onFailure:

Get a category entity by its tag_key property

- (void)getCategoryByTagKey:(NSString *)tag onSuccess:(void ( ^ ) ( OlapicCategoryEntity *category ))success onFailure:(void ( ^ ) ( NSError *error ))failure

Parameters

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.h

getCategoryFromURL:onSuccess:onFailure:

Get a category entity from the API URL

- (void)getCategoryFromURL:(NSString *)URL onSuccess:(void ( ^ ) ( OlapicCategoryEntity *category ))success onFailure:(void ( ^ ) ( NSError *error ))failure

Parameters

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.h

getCategoryFromURL: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 *)parameters

Parameters

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