【发布时间】:2011-11-08 21:45:15
【问题描述】:
将项目列表加载到 UITableview 上,并且能够单击并显示所选行的警报。但是,在警报上说“确定”之后,我重新单击已选择的行,我的代码会分解为“线程 1:程序收到信号:EXC_BAD_ACCESS”。请看下面的代码。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSDictionary *playerselected = [exercises objectAtIndex:indexPath.row];
NSString *video = [playerselected valueForKey:@"video"];
NSString *msg = [[NSString alloc] initWithFormat:@"You have selected %@", video];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Player selected"
message:msg
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
[video release];
[msg release];
}
请告诉我这里可能存在什么问题。
【问题讨论】:
-
好的,我看了一下。你有什么特别想提的问题吗?开个玩笑,尽管如果您提出特定问题确实会有所帮助,并提供尽可能多的细节以帮助我们解决您的问题(例如,错误发生在哪一行)。只是在没有解释的情况下转储代码并不能很好地激励其他人提供帮助。
-
Sry MAc ..更正了上面的问题。
标签: uitableview xcode4 uialertview didselectrowatindexpath