Я обновился до iOS 5 с версией XCode 4.2.
Так как я обновился, я не могу создать правильный рабочий стол в виде контроллера.
1) Представление таблицы отображается на устройстве, но при попытке прокрутки вверх происходит сбой без сообщения об ошибке
2) когда я пытаюсь выбрать ячейку, didSelectRowAtIndexPath не вызывается.
NOTE: the same code was workign for me before upgrating to iOS5.
Это код для файла TableViewController.m
#import "CTableViewController.h"
@implementation CTableViewController
@synthesize arrNames;
-(id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
NSLog(@"CTableViewController::initWithStyle");
// Custom initialization
}
return self;
}
-(void)viewDidLoad
{
[super viewDidLoad];
arrNames = [[NSMutableArray alloc]initWithObjects:@"Peter Frank Brauer",@"Robert Schneider",@"Winfried Walter Kem",@"Eugen Germen Bachle",@"Clara Weib",@"Heinz Guther Winkler",@"Roland Bendel",@"Swen Aschemeyer",@"Patrick Bodingmeier",nil];
}
-(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 [self.arrNames 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];
}
// Configure the cell...
cell.textLabel.text = [self.arrNames objectAtIndex:indexPath.row];
cell.textLabel.font = [UIFont systemFontOfSize:16];
NSLog(@"CTableViewController::cellForRowAtIndexPath");
return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"called didSelectRow method");
}
@end
Спасибо, пожалуйста, помогите
Suse