這裏是新的節目是我的困境:我在拉從Web JSON文件,我能顯示其中一個元素(currDate)到我的tableView,但現在我想顯示更多。從下面的代碼我我會得到它同時顯示currDate和prevDate這裏需要改變
邏輯:
for (NSDictionary *diction in arrayOfEntry) {
NSString *currDate = [diction objectForKey:@"Current Date"];
a = currDate;
NSString *prevDate = [diction objectForKey:@"Previous Date"];
b = prevDate;
[array addObject:a];
}
[[self myTableView]reloadData];
我不知道如果我需要改變任何東西,但我安裝它顯示我如何顯示陣列我viewTable:
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [array count];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(!cell)
{
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = [array objectAtIndex:indexPath.row];
//cell.textLabel.text = [array objectsAtIndexes:indexPath.row];
return cell;
}
,對於環段實際上是在此: (無效)connectionDidFinishLoading :(NSURLConnection *)連接 { NSDictionary * allDataDictionary = [NSJSONSerialization JSONObjectWithData:webData options:0 error:nil]; NSDictionary * feed = [allDataDictionary objectForKey:@「feed」]; NSArray * arrayOfEntry = [feed objectForKey:@「entry」]; .... for ...等等等等等等 – user1832095