Apoya el canal bajando mi App: http://itunes.apple.com/us/app/cifra./id469340790?l=es&ls=1&mt=8
Tutorial 11. Entendiendo como funcionan los TableViews.
Y el codigo.
#pragma mark -
#pragma mark Table View Data Source Methods
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return [self.listData count];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexpath{
static NSString *SimpleTableIdentifier = @"SimpleTableIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: SimpleTableIdentifier];
if (cell == nil)
cell = [[[UITableViewCell alloc]initWithFrame:CGRectZero reuseIdentifier: SimpleTableIdentifier] autorelease]; NSUInteger row = [indexpath row];
cell.textLabel.text = [self.listData objectAtIndex:row];
cell.textLabel.font = [UIFont boldSystemFontOfSize:31];
UIImage *cupcake = [UIImage imageNamed:@"cakekawaii.png"];
cell.imageView.image = cupcake;
return cell;
}
#pragma mark -
#pragma mark Table Delegate Methods
-(NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath{
NSUInteger row = [indexPath row];
if (row == 0)
return nil;
return indexPath;
}
- (void)tableView:(UITableView *)tableView didSelecRowAtIndexPath:(NSIndexPath *)indexPath{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Hey, do you see the disclosure button?" message:@"If you're trying to drill down, touch that instead" delegate:nil cancelButtonTitle:@"Won't happen again" otherButtonTitles:nil]; [alert show]; [alert release];
}
no pusiste len los coments lo que pegaste
nemoaldape 10 months ago
@nemoaldape Ya esta el codigo. Saludos.
LKronecker 9 months ago