に 2 つのラベルを持つストーリーボードがありUITableViewCell
ます。
タイトルと価格。
私のViewController.m
中には、データを含む配列があります(JSONのURLから)。必要なものはすべて取得できますが、このデータをラベルに追加したい場合は、次のようなことを試しました:
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSString *cellIdentifier = @"BasicCell"; UITableViewCell *myCell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
// 表示する位置を取得 Location *item = _feedItems[indexPath.row]; NSString *baseUrl = @"アドレス/宛先/画像"; NSString *urlString = [baseUrl stringByAppendingString:item.thumbnail]; NSURL *urla = [NSURL URLWithString:urlString]; NSData * imageData = [NSData dataWithContentsOfURL:urla]; UIImage * image = [UIImage imageWithData:imageData];
myCell.imageView.image = 画像;
myCell.detailTextLabel.text = item.elementid; // "No visible @interface for 'Location' はセレクター 'objectAtIndex:' を宣言します myCell.textLabel.text = item.element; //"No visible @interface for 'Location' はセレクター 'objectAtIndex:' を宣言します
myCell を返します。}
うまくいかず、その理由がわかりません。エラーメッセージは表示されませんでした。誰でも私を助けることができますか?