私はTableView Controllerを持っていて、配列からObjectを取り込んでいます。私はStoryBoardを使用しています。また、プレースホルダーの一種として、ストーリーボードのセルプロトタイプにラベルを配置する必要があるかどうかはわかりません。TableViewにオブジェクトの配列を設定するには?
My aList変更可能な配列には、宿題タイプのオブジェクトが含まれています。テーブルの各行には 、私は(これらはすでに私の宿題モデルに設定された変数です)表示したい:
-ClassName
-AssignmentTitle
-DueDate
をここで私があります現在持っている
TableViewController.h
@interface AssignmentTableController : UITableViewController
<
AssignmentDelegate
>
@property(strong,nonatomic) Assignment *vc;
@property (strong, nonatomic) NSMutableArray *alist;//array was filled with delegation
@end
TableViewController.m
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return [self.alist count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
Homework *ai = [self.alist objectAtIndex:indexPath.row];
//*******I am not sure what to do from Here******
//*******I need to start displaying 1 object per row,displaying what was stated above***
// Configure the cell...
return cell;
}
[UITableViewの配列からの挿入](http://stackoverflow.com/questions/4367393/populating-a-uitableview-from-arrays) –