2011-01-08 93 views
0

我有一個問題,我的app.Im建立一個具有導航控制器的應用程序。當我選擇一個特定的行,其相關的url將被加載。它工作正常。但如何從這個視圖回到以前的觀點?我試着放置視圖的導航欄頂部,但它不是visible.couldü請幫助我.....如何關閉超鏈接窗口?

我把下面的代碼中沒有selectrowmethod

  • (無效) tableView:(UITableView *)tableView didSelectRowAtIndexPath :(NSIndexPath *)indexPath {獲取選定的cou ntry NSString * selectedCountry = [listOfItems objectAtIndex:indexPath.row];

    // NSString * url = @「」;

    如果(indexPath.row == 0){

    //[email protected]"http://www.osha.gov/dcsp/osp/stateprogs/alaska.html」; //label.text=url; NSLog(@「======」); NSURL * url = [[NSURL alloc] initWithString:@「http://labor.state.ak.us/lss/oshhome.htm」]; [[UIApplication sharedApplication] openURL:url]; // self.label.text = @「url」; // NSLog(@「++++++:%@」,self.label.text); //[email protected]"url「;

    }

    否則如果(indexPath.row == 1){

    NSURL * URL = [[NSURL的alloc] initWithString:@「http://www.ica.state.az.us/ADOSH /「]; [[UIApplication sharedApplication] openURL:url];

    //[email protected]"http://www.osha.gov/dcsp/osp/stateprogs/arizona.html「; } 否則如果(indexPath.row == 2){

    NSURL * URL = [[NSURL的alloc] initWithString:@ 「http://www.dir.ca.gov/occupational_safety.html」]; [[UIApplication sharedApplication] openURL:url];

    //[email protected]"http://www.osha.gov/dcsp/osp/stateprogs/arizona.html「; }

    否則如果(indexPath.row == 3){

    NSURL * URL = [[NSURL的alloc] initWithString:@「http://www.ctdol.state.ct.us/osha/ osha.htm「]; [[UIApplication sharedApplication] openURL:url];

    //[email protected]"http://www.osha.gov/dcsp/osp/stateprogs/arizona.html「; } }

+0

如果您的代碼使用了代碼標籤,更多人願意幫助您。 – starcorn 2011-01-08 09:34:48

+1

你想做什麼? [[UIApplication sharedApplication] openURL:url];將打開Safari應用程序?我認爲你需要閱讀UIApplicationDelegate Protocol Reference。 – 2011-01-08 10:04:40

回答

0

您的代碼打開Safari。你不能從那裏回去。我建議你退房UIWebView