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