-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added example code to show a table view within a popover view.
- Loading branch information
Andreas Katzian
committed
Oct 4, 2010
1 parent
b366b04
commit 322e4f9
Showing
7 changed files
with
661 additions
and
22 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// TablePopoverController.h | ||
// PopoverView | ||
// | ||
// Created by Andreas Katzian on 04.10.10. | ||
// Copyright 2010 Blackwhale GmbH. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
|
||
@interface TablePopoverController : UITableViewController { | ||
|
||
} | ||
|
||
@end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// | ||
// TablePopoverController.m | ||
// PopoverView | ||
// | ||
// Created by Andreas Katzian on 04.10.10. | ||
// Copyright 2010 Blackwhale GmbH. All rights reserved. | ||
// | ||
|
||
#import "TablePopoverController.h" | ||
|
||
|
||
@implementation TablePopoverController | ||
|
||
|
||
|
||
#pragma mark - | ||
#pragma mark Table view data source | ||
|
||
// Return the number of sections. | ||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { | ||
return 3; | ||
} | ||
|
||
|
||
// Return the number of rows in the section. | ||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | ||
return 1; | ||
} | ||
|
||
|
||
// Customize the appearance of table view cells. | ||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | ||
|
||
static NSString *CellIdentifier = @"Cell"; | ||
|
||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | ||
if (cell == nil) { | ||
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; | ||
} | ||
|
||
cell.detailTextLabel.text = [NSString stringWithFormat:@"This is cell nr. %d", indexPath.section]; | ||
cell.textLabel.text = [NSString stringWithFormat:@"Cell %d", indexPath.section]; | ||
|
||
return cell; | ||
} | ||
|
||
|
||
#pragma mark - | ||
#pragma mark Table view delegate | ||
|
||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { | ||
//do something in here | ||
} | ||
|
||
|
||
#pragma mark - | ||
#pragma mark Memory management | ||
|
||
|
||
- (void)dealloc { | ||
[super dealloc]; | ||
} | ||
|
||
|
||
@end | ||
|
Oops, something went wrong.