Я использую tableview для заполнения массива из файла json ... В моем представлении Controller у меня есть tableview. Когда я запускаю проект, мои кодированные представления таблицы не выполняются.мой файл viewcontroller
#import "JSONparserViewController.h"
@implementation JSONparserViewController
@synthesize arraydata;
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
#pragma mark - View lifecycle
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
NSLog(@"No Of Elements in Array Data: %d",[arraydata count]);
return [arraydata count];
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 80;
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
// Configure the cell...
NSLog(@"%@",arraydata);
NSDictionary *aTweet = [arraydata objectAtIndex:[indexPath row]];
cell.textLabel.text = [aTweet objectForKey:@"name"];
// NSDictionary *newArray=[aTweet objectForKey:@"properties"];
//
// NSDictionary *newArray1=[newArray objectForKey:@"propertyMeta"];
// cell.detailTextLabel.text = [newArray1 objectForKey:@"name"];
// cell.detailTextLabel.text = [newArray objectForKey:@"value"];
cell.textLabel.adjustsFontSizeToFitWidth = YES;
cell.textLabel.font = [UIFont systemFontOfSize:12];
cell.textLabel.minimumFontSize = 10;
cell.textLabel.numberOfLines = 4;
cell.textLabel.lineBreakMode = UILineBreakModeWordWrap;
//cell.detailTextLabel.text = [newArray1 objectForKey:@"type"];
// NSURL *url = [NSURL URLWithString:[aTweet objectForKey:@"profile_image_url"]];
// NSData *data = [NSData dataWithContentsOfURL:url];
// cell.imageView.image = [UIImage imageWithData:data];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
NSLog(@"HIIIIIIIIII");
return cell;
}