报销
- / Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- - (void)viewDidLoad {
- arryData = [[NSArray alloc] initWithObjects:@"iPhone",@"Android",@"Plam Pre",@"Windows Mobile",nil];
- [super viewDidLoad];
- }
- - (void)didReceiveMemoryWarning {
- // Releases the view if it doesn’t have a superview.
- [super didReceiveMemoryWarning];
- // Release any cached data, images, etc that aren’t in use.
- }
- - (void)viewDidUnload {
- // Release any retained subviews of the main view.
- // e.g. self.myOutlet = nil;
- }
- - (void)dealloc {
- [arryData release];
- [super dealloc];
- }
- #pragma mark Table view methods
- - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
- return 1;
- }
- // Customize the number of rows in the table view.
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- return [arryData count];
- }
- // 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] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
- }
- // Set up the cell…
- cell.textLabel.text = [arryData objectAtIndex:indexPath.row];
- return cell;
- }
- @end