Guest User

Untitled

a guest
May 24th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. static NSString *dialogueCellIdentifier = @"dialogueCellIdentifier";
  2.  
  3. dialogue_cell *cell = (dialogue_cell *)[tableView dequeueReusableCellWithIdentifier:dialogueCellIdentifier];
  4.  
  5. if (cell == nil) {
  6. NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"dialogue_cell" owner:self options:nil];
  7. cell = [nib objectAtIndex:0];
  8. [[cell lButton] addTarget:self action:@selector(lButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
  9. }
  10.  
  11. [[cell lButton] setTag:[indexPath row]];
  12.  
  13. NSString *row = [NSString stringWithFormat:@"%i",[indexPath row]];
  14. NSString *en = [[self.dataArray objectForKey:row] valueForKey:@"en"];
  15.  
  16. cell.mainText.text = en;
  17.  
  18.  
  19. return cell;
  20. }
  21.  
  22. NSIndexPath *thisCellPath = [NSIndexPath indexPathForRow:[sender tag] inSection:0];
  23. dialogue_cell *thisCell = (dialogue_cell *)[self.dialogueTable cellForRowAtIndexPath:thisCellPath];
  24. NSString *row = [NSString stringWithFormat:@"%i",[sender tag]];
  25. if ([thisCell.languageButton.currentTitle isEqualToString:@"en"]) {
  26. [thisCell.languageButton setTitle:@"zc" forState:UIControlStateNormal];
  27. thisCell.mainText.text = [[self.lineArray objectForKey:row] valueForKey:@"lineText_zc"];
  28. } else {
  29. [thisCell.languageButton setTitle:@"en" forState:UIControlStateNormal];
  30. thisCell.mainText.text = [[self.lineArray objectForKey:row] valueForKey:@"lineText_en"];
  31. }
  32.  
  33. NSIndexPath *thisCellPath = [NSIndexPath indexPathForRow:[sender tag] inSection:0];
  34. dialogue_cell *thisCell = (dialogue_cell *)[self.dialogueTable cellForRowAtIndexPath:thisCellPath];
  35.  
  36. cell=[tableView dequeueReusableCellWithIdentifier:dialogueCellIdentifier];
Add Comment
Please, Sign In to add comment