Я пытаюсь загрузить данные из массива, который был создан путем анализа json ... У меня есть данные json в массивах, но методы табличного представления даже не вызываются ... У меня есть табличное представлениевстроенный в обычный контроллер uiview, он компилирует и все, что таблица просто загружает без данных.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [transactions count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"any cell"];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"any cell"] autorelease];
}
NSLog(@"got here");
cell.textLabel.text = [names objectAtIndex:indexPath.row];
cell.detailTextLabel.text = [prices objectAtIndex:indexPath.row];
return cell;
}
- (void)viewDidLoad
{
[super viewDidLoad];
names = [[NSMutableArray alloc] init];
prices = [[NSMutableArray alloc] init];
[self requestTransactionData];
}
А вот мой файл .h ...
@interface Controller1 : UIViewController
<UITableViewDelegate, UITableViewDataSource>
{
UIActivityIndicatorView *loadingIndicator;
IBOutlet UITableView *myTableView;
IBOutlet UILabel *totalLabel;
NSMutableArray *names;
NSArray *transactions;
NSMutableArray *prices;
}
@property(nonatomic, retain) IBOutlet UIActivityIndicatorView *loadingIndicator;
@property(nonatomic, retain) IBOutlet UILabel *totalLabel;
@property(nonatomic, retain) UITableView *myTableView;
Я не могу использовать ARCдля этого проекта.Я также правильно подключил его в конструкторе интерфейсов ... Это кажется довольно простым, но по некоторым причинам я не могу понять это.Какие-либо предложения?
Спасибо