【发布时间】:2011-03-28 20:42:07
【问题描述】:
大家好,刚刚有一个关于 UIAlertViews 的问题。 我在单元格中有一个按钮,我希望将对象的数据推送到 UIAlertView 正文部分。现在我有这个:
- (void)locationButton:(id)selector{
NSString *addressBody = [NSString stringWithFormat:@"%@", [[testList objectAtIndex:selectedCellIndexPath.row] address]];
UIAlertView *addressView = [[UIAlertView alloc] initWithTitle:nil
message:addressBody
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:@"Show on Map", nil];
[addressView show];
[addressView release];
}
在 viewDidLoad 中,我像这样初始化了 Conference 类
testList = [[NSMutableArray alloc] init];
Conference *conf1 = [[Conference alloc] initWithConferenceId:110];
Conference *conf2 = [[Conference alloc] initWithConferenceId:130];
[testList addObject:conf1];
[testList addObject:conf2];
但是当按下按钮时,警报视图不会显示,最终会崩溃
“由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'-[会议地址]:无法识别的选择器发送到实例0x5e273a0'”
有什么建议吗?
【问题讨论】:
标签: uitableview ios4 uibutton parameter-passing uialertview