5987045388
http://codereview.appspot.com/4798055/ git-svn-id: http://skia.googlecode.com/svn/trunk@2022 2bbb7eff-a529-9590-31e7-b0007b416f81
62 lines
1.6 KiB
Plaintext
62 lines
1.6 KiB
Plaintext
#import "SkUIRootViewController.h"
|
|
#import "SkUISplitViewController.h"
|
|
@implementation SkUIRootViewController
|
|
@synthesize popoverController, popoverButtonItem;
|
|
|
|
//Overwritten from UIViewController
|
|
- (void)viewDidLoad {
|
|
[super viewDidLoad];
|
|
self.contentSizeForViewInPopover = CGSizeMake(200, self.view.bounds.size.height);
|
|
fSamples = [[NSMutableArray alloc] init];
|
|
}
|
|
|
|
- (void)viewDidUnload {
|
|
[super viewDidUnload];
|
|
self.popoverButtonItem = nil;
|
|
}
|
|
|
|
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
|
return YES;
|
|
}
|
|
|
|
- (void)dealloc {
|
|
[popoverController release];
|
|
[popoverButtonItem release];
|
|
[fSamples release];
|
|
[super dealloc];
|
|
}
|
|
|
|
|
|
//Table View Delegate Methods
|
|
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
|
// Return the number of sections.
|
|
return 1;
|
|
}
|
|
|
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
|
// Return the number of rows in the section.
|
|
return [fSamples count];
|
|
}
|
|
|
|
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
|
static NSString *CellIdentifier = @"Cell";
|
|
|
|
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
|
|
if (cell == nil) {
|
|
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
|
|
reuseIdentifier:CellIdentifier] autorelease];
|
|
}
|
|
|
|
cell.textLabel.text = [fSamples objectAtIndex:indexPath.row];
|
|
return cell;
|
|
}
|
|
|
|
//Instance methods
|
|
- (void)addItem:(NSString*)anItem {
|
|
[fSamples addObject:anItem];
|
|
}
|
|
|
|
@end
|
|
|