// Tratamento de eventos:caso o utilizador clique numadascélulasdatabela 你好,伙计们, 我试图显示一个UIAlertView来显示我已存储的“电影”对象的摘要,我的想法是如果我存储了电影的网站则显示其中的两个按钮,或者只是为了显示电影没有的电影之一。
奇怪的是,我不是一个,而是两个,而是三个非常不同的UIAlertViews!
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *ShinraTensei = (@"%@ \n", [[array_resultados objectAtIndex:indexPath.row] Sumario]);
if([[array_resultados objectAtIndex:indexPath.row] WebSite] != nil)
{
// NSLog(@"Nulo");
UIAlertView* myAlertView = [[UIAlertView alloc] initWithTitle:[[array_resultados objectAtIndex:indexPath.row] TituloFilme] message:ShinraTensei delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
CGAffineTransform myTransform = CGAffineTransformMakeTranslation(0.0, 0.0);
[myAlertView setTransform:myTransform];
[myAlertView show];
[myAlertView release];
myAlertView = nil;
}
else
{
UIAlertView* myAlertView2 = [[UIAlertView alloc] initWithTitle:[[array_resultados objectAtIndex:indexPath.row] TituloFilme] message:ShinraTensei delegate:self cancelButtonTitle:@"LOL" otherButtonTitles:nil];
CGAffineTransform myTransform2 = CGAffineTransformMakeTranslation(0.0, 0.0);
[myAlertView2 setTransform:myTransform2];
[myAlertView2 show];
[myAlertView2 release];
myAlertView = nil;
}
}
编辑:如果您看不到此帖中的图片,请访问:http://i41.tinypic.com/2vc9hg9.jpg
答案 0 :(得分:1)
第一个对话框是标准的UIAlertView。第二个我只能猜测,但我会假设当你有太多的消息文本时,它看起来不同,以通知用户他们可以滚动消息。第三个是UIAlertView,只有一个标题,根本没有消息。
答案 1 :(得分:0)
答案 2 :(得分:0)
那你的实际问题是什么?我和下一个人一样喜欢截图,但我在任何地方都没有看到问题?
答案 3 :(得分:0)
看起来这里的逻辑是好的。 Youi很可能是您的数据模型有问题。
我猜测[[array_resultados objectAtIndex:indexPath.row] TituloFilme]消息:ShinraTensei]的值是nil,在你看到第三种对话框的情况下。