-3

私のUITableViewには(Google、Facebook、Yahoo)があり、選択に基づいて、そのページにリダイレクトする必要があります

何を書く必要がありdidSelectRowAtIndexPathますか?

4

2 に答える 2

0
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
   [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[[statuses objectAtIndex:indexPath.row] valueForKey:@"LoginUrl"]]];
}

あなたの鍵が LoginUrl

于 2013-04-08T12:27:34.507 に答える
0

次のコードを使用します: 選択コードを以下に配置するか、カスタム初期化を介して、選択した値を単一の値にコントローラーに渡し、送信された値に基づいて処理します

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
        [self moveToNewViewControllerForRow:(indexPath.row)];
    }

    -(void)moveToNewViewControllerForRow:(NSInteger)forTheRow{

        switch (forTheRow) {
            case 0:
            {
            }

                break;
            case 1 :
            {
            }
                break;
            case 2 :
            {
            }
                break;   
        }


    }
于 2013-04-08T12:29:48.837 に答える