
This controller works exactly like the other generic ones I've posted. You create an instance, assign yourself as delegate and implement the delegate protocol, then push it onto the stack. The sole delegate method will be used to inform you of a new selection, if one was made. So, here's an example of creating an instance and putting it on the stack:
SelectionListViewController *controller = ;
controller.delegate = self;
controller.list = myNSArrayWithAllPossibleSelections;
controller.initialSelection = theIndexOfTheCurrentlySelectedItem;
;
;Then, we just need to implement the:
- (void)rowChosen:(NSInteger)row
Everything else is handled for you. Here's the code:
SelectionListViewController.h
//
// SelectionListViewController.h
// iContractor
//
// Created by Jeff LaMarche on 2/18/09.
//
SelectionListViewController.m
//
// SelectionListViewController.m
// iContractor
//
// Created by Jeff LaMarche on 2/18/09.
//
0 comments:
Post a Comment