我有一個數組,我想保存這UITable,但它是不可見的,我的代碼是如何將NSMutableArray保存到表中,而數組已存儲另一個不同對象的數組?
- (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 [myArrayNew count];
}
// 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:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell...
NSString *cellValue = [myArrayNew objectAtIndex:indexPath.row];
cell.textLabel.text = cellValue;
return cell;
}
和該陣列是一些其他的數組,而不是單個對象,
你怎麼想顯示陣列值的UITableView的陣列? – KingofBliss 2011-02-08 05:37:50
所有3行中的元素,我想這樣 – 2011-02-08 05:56:58
請確保你已經設置了表的數據源和委託。然後按照羅賓的指示。謝謝, – GameLoading 2011-02-08 06:17:35