- (void)receiveData:(NSData *)data {
self.office = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
self.files = [office objectForKey:@"files"];
[self.myTableView reloadData];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.files.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [[UITableViewCell alloc] init];
NSDictionary *file = [self.files objectAtIndex:indexPath.row];
cell.textLabel.text = [file objectAtIndex:1]; //here i want to get data from the array
cell.textLabel.font = [UIFont boldSystemFontOfSize:15];
cell.textLabel.numberOfLines = 1;
return cell;
NSLog(@"files:\n%@", file);
}
NSDictionary オフィスに保存した json 応答があり、その json の配列は NSArray ファイルに保存されています。ファイル配列を別の NSDictionary ファイルに渡し、そのファイルに保存されているデータに従って、テーブルにそのデータが必要です行ですが、ファイル配列に「キー」がなく、その配列の値のみです。
だから私の質問は、そのファイル辞書でその値をどのように指すことができるかということです.私はコメントをしたいので、そのコメントを見てください....