acfcbd32a4c4ece5db0c3d6c4960cc7a81731d8e
[atutor.git] / mods / atsocial_iphone_app / Classes / GroupsViewController.m
1 //
2 //  GroupsViewController.m
3 //  ATutor
4 //
5 //  Created by Quang Anh Do on 08/08/2010.
6 //  Copyright 2010 Quang Anh Do. All rights reserved.
7 //
8
9 #import "GroupsViewController.h"
10 #import "CommonFunctions.h"
11 #import "OSConsumer.h"
12 #import "OAServiceTicket.h"
13 #import "NSDictionary_JSONExtensions.h"
14 #import "ATutorAppDelegate.h"
15
16 @interface GroupsViewController (Private)
17
18 - (void)groupsCallback:(OAServiceTicket *)ticket didFinishWithResponse:(id)response;
19
20 @end
21
22 @implementation GroupsViewController
23
24 - (id)init {
25         if (self = [super init]) {
26                 self.title = TTLocalizedString(@"Groups", @"");
27                 self.autoresizesForKeyboard = YES;
28                 self.variableHeightRows = YES;
29                 
30                 OSConsumer *consumer = [(ATutorAppDelegate *)[[UIApplication sharedApplication] delegate] consumer];
31                 [consumer getDataForUrl:@"/groups/@me" 
32                                   andParameters:nil 
33                                            delegate:self 
34                           didFinishSelector:@selector(groupsCallback:didFinishWithResponse:)];
35         }
36         
37         return self;
38 }
39
40 - (void)loadView {
41         [super loadView];
42         
43         self.tableView.allowsSelection = NO;
44 }
45
46 - (void)groupsCallback:(OAServiceTicket *)ticket didFinishWithResponse:(id)response {
47         if (ticket.didSucceed) {
48                 
49         } else {
50                 alertMessage(@"Error", @"The service groups is not implemented");
51         }
52 }
53
54 @end