Note that there are some explanatory texts on larger screens.

plurals
  1. POTry to present uitableview with nsmutablearray
    text
    copied!<p>ok i try my best to explain my problem, I try to create an array after user finish picking a picture from their device</p> <pre><code>- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { listReceived = [NSArray arrayWithObjects:labelName.text,labelAddress.text,labelAge.text,@"filePicname.png",nil]; } </code></pre> <p>and it can repeat several times (more than once), so i try to put it in nsmutablearray</p> <pre><code>[allListReceived addObject:listReceived]; </code></pre> <p>after that i want to show it all in uitableview, by using custom cell. this is what i try to do:</p> <pre><code> - (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; } </code></pre> <p>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.</p> <p>thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload