Permalink
Browse files

Import into GitHub

  • Loading branch information...
rickfillion committed Jan 2, 2011
0 parents commit b8c347737165210564f5ef96aac1ced3f58eaf23
@@ -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
@@ -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 not shown.
Oops, something went wrong.

0 comments on commit b8c3477

Please sign in to comment.