ok i try my best to explain my problem, I try to create an array after user finish picking a picture from their device
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
listReceived = [NSArray arrayWithObjects:labelName.text,labelAddress.text,labelAge.text,@"filePicname.png",nil];
}
and it can repeat several times (more than once), so i try to put it in nsmutablearray
[allListReceived addObject:listReceived];
after that i want to show it all in uitableview, by using custom cell. this is what i try to do:
- (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;
}
Yes i know the nsmutablearray is not used yet, and all the label in custom cell the is the same string as array first index, i read that i have to use nsdictionary. But still no luck in search. If you guys can help me, im really appreciate.
thanks