BSJobList

Last weekend I wanted to add some kind of list with checkboxes to CuteClips in order to execute a list of tasks… it evolved into BSJobList which is a very easy way to open a window and ask for things that need to be performed. After OK is clicked, all these jobs are executed in the order they are displayed.

The usage is pretty easy:

  • load the bundle BSJobList.bundle

    NSBundle* bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"BSJobList" 
    																			ofType:@"bundle"]];
    Class jobListClass = [bundle principalClass];
    
    
  • create an array with jobs:

    NSArray* actionsBig = [NSArray arrayWithObjects:
    	[BSJob jobWithName:@"order me a pizza" action:@selector(callForHelp) target:self position:1],
    	[BSJob jobWithName:@"order me a coke" action:@selector(orderACoke) target:self position:2],
    	nil];
    

    of course the selectors have to be implemented in self 😉

  • ask the BSJobList class to run the jobs and give it nice title

    	
    	[jobListClass askToRunJobs:actions withTitle:@"What should i order?"];
    

    this method call returns YES or NO, if you want to know if the user hit Cancel or Ok

The result should look like this:

Bsjob List Screenshot

you can download it from: CodeBeach

Have fun!
Karsten

Comments are closed.