-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExampleController.m
More file actions
executable file
·46 lines (34 loc) · 1.29 KB
/
Copy pathExampleController.m
File metadata and controls
executable file
·46 lines (34 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// ExampleController.m
// InEvent
//
// Created by Pedro Góes on 29/10/13.
// Copyright (c) 2013 Pedro Góes. All rights reserved.
//
#import "ExampleController.h"
#import "INAPI.h"
@implementation ExampleController
#pragma mark - Initialization
- (id)init {
if (self = [super init]) {
[[[INEventAPIController alloc] initWithDelegate:self returnPreviousSave:NO] findWithName:name withCity:city withTheme:theme withDateBegin:dateBegin withDateEnd:dateEnd withOrder:@"any"];
}
return self;
}
#pragma mark - APIController Delegate
- (void)apiController:(INAPIController *)apiController didPartiallyReceiveDictionaryFromServer:(CGFloat)percentage {
// Show how much has already loaded
}
- (void)apiController:(InEventAPIController *)apiController didLoadDictionaryFromServer:(NSDictionary *)dictionary {
if ([apiController.method isEqualToString:@"method"]) {
// Do something with your data
NSLog(@"error: %@", [[dictionary objectForKey:@"data"] description]);
}
}
- (void)apiController:(InEventAPIController *)apiController didSaveForLaterWithError:(NSError *)error {
// Save your data to have a consistent UI
}
- (void)apiController:(InEventAPIController *)apiController didFailWithError:(NSError *)error {
// Treat your error
}
@end