由于某种原因,这个UITableView不断崩溃,它似乎像UITableView无法显示secondsString由于某种原因,但我不知道为什么...请帮我在这里因为我不知道我可以是做错了.....谢谢!TableView崩溃
#import "SettingsView.h"
@implementation SettingsView
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
transmissionSetup = [[TransmissionSetupViewController alloc] initWithNibName:@"TransmissionSetupViewController" bundle:nil];
transmissionSetup.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
NSLog(@"%i", [self getMinutes]);
[self setSeconds:10];
secondsString = [NSString stringWithFormat:@"%i", [self getSeconds]];
[self.tableView reloadData];
}
#pragma mark Table view methods
// 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] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
}
if (indexPath.section == 0) {
cell.textLabel.text = @"Every:";
cell.detailTextLabel.text = secondsString;
}
// Set up the cell...
return cell;
}
@end
你在控制台看到什么错误? – 2010-07-16 12:15:37
2010-07-16 14:16:28.864 Navex [31130:207] 0 编程接收信号:“EXC_BAD_ACCESS”。 这是我得到的错误 – 2010-07-16 12:16:53
我删除了与您的问题无关的部分代码 - 请尽量避免发布不必要的代码,以便更容易地帮助您 – Vladimir 2010-07-16 12:22:59