わかりました私は自分の問題を説明するために最善を尽くします.ユーザーがデバイスから写真を選択し終わった後、配列を作成しようとします
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
listReceived = [NSArray arrayWithObjects:labelName.text,labelAddress.text,labelAge.text,@"filePicname.png",nil];
}
そしてそれは数回(複数回)繰り返すことができるので、nsmutablearrayに入れようとします
[allListReceived addObject:listReceived];
その後、カスタムセルを使用して、uitableview ですべて表示したいと思います。これは私がやろうとしていることです:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"TopCell";
MyCustomCell *cell = (MyCustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
NSArray *topLevelObjects;
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
//topLevelObjects = [[NSBundle mainBundle]loadNibNamed:@"MyCustomCell-iPhone.xib" owner:nil options:nil];
}else{
topLevelObjects = [[NSBundle mainBundle]loadNibNamed:@"MyCustomCell-iPad.xib" owner:nil options:nil];
}
for (id currentObject in topLevelObjects)
{
if ([currentObject isKindOfClass:[UITableViewCell class]])
{
cell = (MyCustomCell *) currentObject;
cell.Label1.text = [allListTransfer objectAtIndex:indexPath.row];
cell.Label2.text = [allListTransfer objectAtIndex:indexPath.row];
cell.Label3.text = [allListTransfer objectAtIndex:indexPath.row];
cell.Label4.text = [allListTransfer objectAtIndex:indexPath.row];
cell.Label5.text = [allListTransfer objectAtIndex:indexPath.row];
break;
}
}
}
return cell;
}
はい、nsmutablearray がまだ使用されていないことはわかっています。カスタム セル内のすべてのラベルは、配列の最初のインデックスと同じ文字列です。nsdictionary を使用する必要があることを読みました。しかし、検索ではまだ運がありません。皆さんが私を助けることができれば、本当に感謝しています。
ありがとう