Permalink
Browse files

Code clean-up and spacing fixes.

  • Loading branch information...
1 parent b8a97d8 commit abac6f57ae9370d2d5a5c76e776546a5de54b5b0 @logancollins committed Jul 27, 2012
@@ -618,6 +618,7 @@
EAA45E04155CE44B00F93E40 /* Products */,
);
sourceTree = "<group>";
+ usesTabs = 0;
};
EAA45E04155CE44B00F93E40 /* Products */ = {
isa = PBXGroup;
@@ -912,6 +913,7 @@
EAA45DF9155CE44B00F93E40 /* Project object */ = {
isa = PBXProject;
attributes = {
+ CLASSPREFIX = MO;
LastUpgradeCheck = 0450;
ORGANIZATIONNAME = "Sunflower Softworks";
};
@@ -15,64 +15,64 @@
@implementation MOBridgeSupportController {
- NSMutableArray *_loadedURLs;
- NSMutableArray *_loadedLibraries;
- NSMutableDictionary *_symbols;
- MOBridgeSupportParser *_parser;
+ NSMutableArray *_loadedURLs;
+ NSMutableArray *_loadedLibraries;
+ NSMutableDictionary *_symbols;
+ MOBridgeSupportParser *_parser;
}
+ (MOBridgeSupportController *)sharedController {
- static MOBridgeSupportController *sharedController = nil;
- static dispatch_once_t onceToken;
- dispatch_once(&onceToken, ^{
- sharedController = [[self alloc] init];
- });
- return sharedController;
+ static MOBridgeSupportController *sharedController = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ sharedController = [[self alloc] init];
+ });
+ return sharedController;
}
- (id)init {
- self = [super init];
- if (self) {
- _loadedURLs = [[NSMutableArray alloc] init];
- _loadedLibraries = [[NSMutableArray alloc] init];
- _symbols = [[NSMutableDictionary alloc] init];
- _parser = [[MOBridgeSupportParser alloc] init];
- }
- return self;
+ self = [super init];
+ if (self) {
+ _loadedURLs = [[NSMutableArray alloc] init];
+ _loadedLibraries = [[NSMutableArray alloc] init];
+ _symbols = [[NSMutableDictionary alloc] init];
+ _parser = [[MOBridgeSupportParser alloc] init];
+ }
+ return self;
}
#pragma mark -
#pragma mark Loading
- (BOOL)isBridgeSupportLoadedForURL:(NSURL *)aURL {
- return [_loadedURLs containsObject:aURL];
+ return [_loadedURLs containsObject:aURL];
}
- (BOOL)loadBridgeSupportAtURL:(NSURL *)aURL error:(NSError **)outError {
- if ([self isBridgeSupportLoadedForURL:aURL]) {
- return YES;
- }
-
- MOBridgeSupportLibrary *library = [_parser libraryWithBridgeSupportURL:aURL error:outError];
- if (library == nil) {
- return NO;
- }
-
- [_loadedURLs addObject:aURL];
- [_loadedLibraries addObject:library];
-
- for (NSString *name in library.symbols) {
- MOBridgeSupportSymbol *symbol = [library.symbols objectForKey:name];
- if ([_symbols objectForKey:name] == nil) {
- [_symbols setObject:symbol forKey:name];
- }
- else {
- //NSLog(@"Symbol with name \"%@\" is already loaded.", name);
- }
- }
-
- return YES;
+ if ([self isBridgeSupportLoadedForURL:aURL]) {
+ return YES;
+ }
+
+ MOBridgeSupportLibrary *library = [_parser libraryWithBridgeSupportURL:aURL error:outError];
+ if (library == nil) {
+ return NO;
+ }
+
+ [_loadedURLs addObject:aURL];
+ [_loadedLibraries addObject:library];
+
+ for (NSString *name in library.symbols) {
+ MOBridgeSupportSymbol *symbol = [library.symbols objectForKey:name];
+ if ([_symbols objectForKey:name] == nil) {
+ [_symbols setObject:symbol forKey:name];
+ }
+ else {
+ //NSLog(@"Symbol with name \"%@\" is already loaded.", name);
+ }
+ }
+
+ return YES;
}
@@ -97,7 +97,7 @@ - (NSDictionary *)performQueryForSymbolsOfType:(NSArray *)classes {
}
- (id)performQueryForSymbolName:(NSString *)name {
- return [_symbols objectForKey:name];
+ return [_symbols objectForKey:name];
}
- (id)performQueryForSymbolName:(NSString *)name ofType:(Class)klass {
@@ -10,68 +10,68 @@
@implementation MOBridgeSupportLibrary {
- NSMutableArray *_dependencies;
- NSMutableDictionary *_symbols;
+ NSMutableArray *_dependencies;
+ NSMutableDictionary *_symbols;
}
@synthesize name=_name;
@synthesize URL=_URL;
- (id)init {
- self = [super init];
- if (self) {
- _dependencies = [[NSMutableArray alloc] init];
- _symbols = [[NSMutableDictionary alloc] init];
- }
- return self;
+ self = [super init];
+ if (self) {
+ _dependencies = [[NSMutableArray alloc] init];
+ _symbols = [[NSMutableDictionary alloc] init];
+ }
+ return self;
}
#pragma mark -
#pragma mark Dependencies
- (NSArray *)dependencies {
- return _dependencies;
+ return _dependencies;
}
- (void)setDependencies:(NSArray *)dependencies {
- [_dependencies setArray:dependencies];
+ [_dependencies setArray:dependencies];
}
- (void)addDependency:(NSString *)dependency {
- if (![_dependencies containsObject:dependency]) {
- [_dependencies addObject:dependency];
- }
+ if (![_dependencies containsObject:dependency]) {
+ [_dependencies addObject:dependency];
+ }
}
- (void)removeDependency:(NSString *)dependency {
- if ([_dependencies containsObject:dependency]) {
- [_dependencies removeObject:dependency];
- }
+ if ([_dependencies containsObject:dependency]) {
+ [_dependencies removeObject:dependency];
+ }
}
#pragma mark -
#pragma mark Symbols
- (NSDictionary *)symbols {
- return _symbols;
+ return _symbols;
}
- (void)setSymbols:(NSDictionary *)symbols {
- [_symbols setDictionary:symbols];
+ [_symbols setDictionary:symbols];
}
- (MOBridgeSupportSymbol *)symbolWithName:(NSString *)name {
- return [_symbols objectForKey:name];
+ return [_symbols objectForKey:name];
}
- (void)setSymbol:(MOBridgeSupportSymbol *)symbol forName:(NSString *)name {
- [_symbols setObject:symbol forKey:name];
+ [_symbols setObject:symbol forKey:name];
}
- (void)removeSymbolForName:(NSString *)name {
- [_symbols removeObjectForKey:name];
+ [_symbols removeObjectForKey:name];
}
@end
Oops, something went wrong.

0 comments on commit abac6f5

Please sign in to comment.