0
希望对你有好的和快速的... 下面的代码在模拟器上工作正常,但没有在iPhone上工作,有什么想法?didSelectRowAtIndexPath在模拟器上工作不是iphone
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if([[dataTable cellForRowAtIndexPath:indexPath].textLabel.text isEqualToString:@"Telephone"]){
NSString *tel = [[[NSString alloc] initWithFormat:(@"tel://%@"),[selectedData objectForKey:@"telephone"]] autorelease];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:tel]];
} else {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.apple.com"]];
}
}
**编辑
若要通过不工作我的意思是,当点击(在这种情况下)第二的tableview细胞时使用的Safari在www.apple.com模拟器弹出扩大一点。另一个命令没有任何反应,因为模拟器上没有电话。但在iPhone上,任何一个单元格都不会发生点击。
请定义“不工作”。 – tobiasbayer 2010-09-24 13:24:07
嗨,好吧,我已经扩展了一些主帖 – jimbo 2010-09-24 13:32:12
你有调试吗? “openURL”行是否被调用? – tobiasbayer 2010-09-24 13:46:41