0
我解析xml文件以獲取電話號碼值(aMarker.web = weblink)。其中marker是我在解析器控制器中獲取的xml文件中的屬性。我能夠通過使用如何從iphone應用程序查詢中在safari中調用weblink
[w_Bcard setTitle:[NSString stringWithFormat:@"%@",aMarker.web] forState:UIControlStateNormal];
上設置按鈕標題本網站鏈接字符串,但通過點擊按鈕,我不能撥打該號碼。看我的代碼
- (IBAction)weblink_BcardVeiw
{
NSIndexPath *selectedIndexPath = [self.tableView indexPathForSelectedRow];
marker *aMarker = (marker *)[appDelegate.markers objectAtIndex:selectedIndexPath.row];
for (int selectedIndexPath = 0; selectedIndexPath < [appDelegate.markers count]; selectedIndexPath++)
{
NSString *utfString = [NSString stringWithFormat:@"%@",aMarker.web];
NSURL *url = [NSURL URLWithString:utfString];
[[UIApplication sharedApplication] openURL:url];
NSLog(@"%@",url);
}
[self.tableView deselectRowAtIndexPath:selectedIndexPath animated:YES];
通過NSloging m獲取相應的網址,但無法在safari中打開此網址。我應該在哪裏糾正上面的代碼? 我也想通過傳遞動態字符串aMarker.email來調用郵件應用程序。你也可以提供代碼嗎?
我剛剛能夠通過應用程序打電話。我沒有使用dattdetector的東西...看到http://stackoverflow.com/questions/8165796/how-to-make-call-from-iphone-app-on-xml-parser-value/8166595#8166595 –