テーブルビューを持つアプリを作成していますが、テーブルビューにデータを追加できません
.h ファイルに NewTable という名前の .xip ファイルにテーブル ビューがあり、これは .m ファイルで使用しているコードです (listData は配列です):
- (void)viewDidLoad{
[super viewDidLoad];
[self TestTable];
}
-(void)TestTable{
NSArray *array = [[NSArray alloc] initWithObjects:@"Vishal",@"Vinod",@"Sachin",@"Nilesh",@"Balu",@"Amrita",
@"susho",@"Akash",@"Nil",@"Lop",@"Koi",@"Absoulate",@"Dwalin",
@"Fili",@"Kili",@"Oin",@"Gloin",@"Bifur",@"Bofur",@"Bombur",nil];
self.listData = array;
[array release];
self.listData= array;
[self.NewTable reloadData];
}
- (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] autorelease];
}
NSUInteger row = [indexPath row];
cell.textLabel.text = [listData objectAtIndex:row];
return cell;
}
{{{{{{{{{{また、nslog を追加しても、コンソールにcellForRowAtIndexPath
何も出力されません!}}}}}}}}}}} {{{{{{{{{{{追加した場合も同様ですnslog がコンソールにcellForRowAtIndexPath
何も出力されません!}}}}}}}}}}} {{{{{{{{{{また、nslog を追加しても、コンソールにcellForRowAtIndexPath
何も出力されません!}}}}}} }}}}}