0

Web からJSON MutableArrayを取得します。YouTube の URL 文字列が含まれています..

意図は、各セルで実行することUIWebViewです。

私のコード: コードを実装する方法? ありがとう。

@property (nonatomic, strong) NSMutableArray* arrMovies;
@synthesize arrMovies;


    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyIdentifier"];

        if (cell == nil) {
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"MyIdentifier"];

            cell.selectionStyle = UITableViewCellSelectionStyleBlue;
        }



        cell.textLabel.text = [[self.arrMovies objectAtIndex:indexPath.row] valueForKey:@"title"];

        cell.detailTextLabel.text = [NSString stringWithFormat:@"%@ views | Duration: %i",

      [[self.arrMovies objectAtIndex:indexPath.row] valueForKey:@"viewCount"],intMinutes];





        return cell;
    }
4

1 に答える 1

1

UIWebView とは何かを誤解していると思います。UIWebView を使用すると、Web コンテンツをアプリケーションに埋め込むことができます。これは、Web リクエストを実行して JSONString を取得し、それを解析してビューに表示することと同じではありません。それがあなたが本当にどうするかを求めていることだと思います。質問を編集して確認してください。

上記のコードの具体的な問題点は何ですか? どのような問題に直面していますか? あなたの問題は、実装ファイルに@property (nonatomic, strong) NSMutableArray* arrMovies;andが必要なことだと思います。@synthesize artMoves = _artMovies;

artMovies プロパティの getter も必ずオーバーライドしてください。

于 2013-01-17T17:32:27.657 に答える