didSelectRowAtIndexPath working on simulator not iphone
Hopefully a nice and quick one for you... the below code is working fine on the simulator, but not working on the iPhone, any ideas?
- (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"]];
}
}
**Edit
To expand a little by not working I mean, when the (in this case) second tableview cell is clicked Safari pops up with www.apple.com on the Simulator. Nothing happens with the other command as no phone o开发者_Go百科n simulator. But on iphone nothing happens on either cell click.
Worked it out, after a bit of playing the 'Base SDK' was set to iOS Simulator 4.0 not iPhone 4.0.
精彩评论