0
-(void) reload{
[self.tableViewa reloadData];
}
-(void) viewWillAppear:(BOOL)animated{
[self.tableViewa reloadData];
[cachedProperties setTags:nil];
self.tabBarController.navigationItem.rightBarButtonItem =nil;
self.tabBarController.navigationItem.leftBarButtonItem =nil;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [[cachedProperties getTags] count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CheckMarkCellIdentifier = @"CheckMarkCellIdentifier";
UITableViewCell * cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CheckMarkCellIdentifier] autorelease];
NSUInteger row = [indexPath row];
if([[[cachedProperties getTags] objectAtIndex:row] isNotEmpty]){
cell.textLabel.text = [[cachedProperties getTags]objectAtIndex:row];
cell.accessoryType= UITableViewCellAccessoryDetailDisclosureButton;
}
return cell;
}
ことcannt、私は[self.tableviewa reloadData]機能numberOfRowInSectionを有する方法リロードを呼び出すときどのようにすることができますか?この問題の原因は何ですか?なぜのUITableViewはviewWillAppearがコードは[self.tableviewa reloadData]であり、numberOfRowsInSectionを呼び出すときに、この方法でreloadData
firstTime viewWillAppearが呼び出されたため、[cachedProperties setTags:nil]がタグを設定し、tableViewがnullでないようにするために-(void) reload{ [self.tableViewa reloadData]; }
または[thatClass.tableViewa reloadData]を呼び出します。 tableViewがreloadDataでないのはなぜですか?
何 'numberOfSectionsInTableViewについて:'メソッド?それが '0'以外の値を返すことを確認しましたか? –