2010-09-24 68 views
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上,任何一個單元格都不會發生點擊。

+0

請定義「不工作」。 – tobiasbayer 2010-09-24 13:24:07

+0

嗨,好吧,我已經擴展了一些主帖 – jimbo 2010-09-24 13:32:12

+0

你有調試嗎? 「openURL」行是否被調用? – tobiasbayer 2010-09-24 13:46:41

回答

0

解決了這個問題,在播放「Base SDK」後,iOS模擬器4.0設置爲不是iPhone 4.0。

相關問題