didSelectRowAtIndexPath在模拟器上工作,而不是在iphone上

didSelectRowAtIndexPath在模拟器上工作,而不是在iphone上,iphone,objective-c,cocoa-touch,Iphone,Objective C,Cocoa Touch,希望给你一个又好又快的。。。 下面的代码在模拟器上运行良好,但在iPhone上不起作用,有什么想法吗 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if([[dataTable cellForRowAtIndexPath:indexPath].textLabel.text isEqualToString:@"Telephone"]){

希望给你一个又好又快的。。。 下面的代码在模拟器上运行良好,但在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上,任何一次点击都不会发生任何事情。

在将“基本SDK”设置为iOS Simulator 4.0而不是iphone 4.0后,我解决了这个问题。

嗨,托布,我已经扩展了主帖子,你调试了吗?openURL行被调用了吗?出于某种原因,我的iphone 4出现了一个问题,无法让我看到任何输出,但当我在模拟器上的两个openURL调用之前都放置了一个NSLog,它们都出现了。如果你使用调试器呢?