NSMutableArray
a の値を aに表示したいUITableView
。にNSMutableArray
は、オブジェクトの値があります。しかし、UITableView
何も表示されません。静的な値で法線を使用すると、NSArray
うまく機能します。
これは私のコードです:
これは私のオブジェクトです
@interface Getraenke_Object : NSObject {
NSString *name;
}
私のNSMutableArray
NSMutableArray *getraenkeArray;
here is where I get the values into the array:
for(int i = 0; i < [getraenkeArray count]; i++)
{
[_produktName addObject:[[getraenkeArray objectAtIndex:i]getName]];
NSLog(@"test: %@",_produktName);
}
それが私がそれを表示しようとする方法ですUITableView
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"ProduktCell";
ProduktTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[ProduktTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
int row = [indexPath row];
cell.produktName.text = _produktName [row];
return cell;
}