Created
February 23, 2010 16:46
-
-
Save primalmotion/312391 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)populateTabsFromPlist | |
{ | |
@each(var module in [_plistObject objectForKey:@"Modules"]) | |
{ | |
var currentModuleType = [module objectForKey:@"type"]; | |
if ([self moduleType] == currentModuleType) | |
{ | |
var folder = [module objectForKey:@"folder"]; | |
var path = [self modulesPath] + folder + "/"; | |
var bundle = [CPBundle bundleWithPath:path] | |
[bundle loadWithDelegate:self]; | |
[bundle setModuleInfo:module]; | |
} | |
} | |
} | |
- (void)bundleDidFinishLoading:(CPBundle)aBundle | |
{ | |
var theViewController = [[CPViewController alloc] initWithCibName:[[aBundle moduleInfo] objectForKey:@"cibname"] bundle:aBundle]; | |
var newViewItem = [[CPTabViewItem alloc] initWithIdentifier:[[aBundle moduleInfo] objectForKey:@"label"]]; | |
[newViewItem setLabel:[[aBundle moduleInfo] objectForKey:@"label"]]; | |
[newViewItem setView:[theViewController view]]; | |
[self addTabViewItem:newViewItem]; | |
[[theViewController view] initializeWithContact:[self contact] andRoster:[self roster]]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment