Skip to content

Commit

Permalink
Import into GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
rickfillion committed Jan 2, 2011
0 parents commit b8c3477
Show file tree
Hide file tree
Showing 21 changed files with 5,418 additions and 0 deletions.
22 changes: 22 additions & 0 deletions AppController.h
@@ -0,0 +1,22 @@
//
// AppController.h
// ServerSwitchboard
//
// Created by Rick Fillion on 23/07/09.
// All code is provided under the New BSD license.
//

#import <Cocoa/Cocoa.h>


@interface AppController : NSObject {
NSArray *companies;
BOOL updating;
}

@property (nonatomic, copy) NSArray *companies;
@property (nonatomic, assign) BOOL updating;

- (IBAction)update:(id)sender;

@end
40 changes: 40 additions & 0 deletions AppController.m
@@ -0,0 +1,40 @@
//
// AppController.m
// ServerSwitchboard
//
// Created by Rick Fillion on 23/07/09.
// All code is provided under the New BSD license.
//

#import "AppController.h"
#import "ServerSwitchboard.h"

@implementation AppController

@synthesize companies;
@synthesize updating;

- (void)awakeFromNib
{
[self update: self];
}

- (void)updateCompanies:(NSDictionary *)returnData error:(NSError *)error
{
self.updating = NO;
if (error)
{
// handle the error
return;
}
self.companies = [returnData valueForKey:@"companies"];
}

- (IBAction)update:(id)sender
{
self.updating = YES;
self.companies = [NSArray array];
[[ServerSwitchboard switchboard] companiesWithTarget:self selector:@selector(updateCompanies:error:)];
}

@end
Binary file added English.lproj/InfoPlist.strings
Binary file not shown.

0 comments on commit b8c3477

Please sign in to comment.