Skip to content

Instantly share code, notes, and snippets.

@primalmotion
Created February 23, 2010 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save primalmotion/312391 to your computer and use it in GitHub Desktop.
Save primalmotion/312391 to your computer and use it in GitHub Desktop.
- (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