Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static NSString *dialogueCellIdentifier = @"dialogueCellIdentifier";
- dialogue_cell *cell = (dialogue_cell *)[tableView dequeueReusableCellWithIdentifier:dialogueCellIdentifier];
- if (cell == nil) {
- NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"dialogue_cell" owner:self options:nil];
- cell = [nib objectAtIndex:0];
- [[cell lButton] addTarget:self action:@selector(lButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
- }
- [[cell lButton] setTag:[indexPath row]];
- NSString *row = [NSString stringWithFormat:@"%i",[indexPath row]];
- NSString *en = [[self.dataArray objectForKey:row] valueForKey:@"en"];
- cell.mainText.text = en;
- return cell;
- }
- NSIndexPath *thisCellPath = [NSIndexPath indexPathForRow:[sender tag] inSection:0];
- dialogue_cell *thisCell = (dialogue_cell *)[self.dialogueTable cellForRowAtIndexPath:thisCellPath];
- NSString *row = [NSString stringWithFormat:@"%i",[sender tag]];
- if ([thisCell.languageButton.currentTitle isEqualToString:@"en"]) {
- [thisCell.languageButton setTitle:@"zc" forState:UIControlStateNormal];
- thisCell.mainText.text = [[self.lineArray objectForKey:row] valueForKey:@"lineText_zc"];
- } else {
- [thisCell.languageButton setTitle:@"en" forState:UIControlStateNormal];
- thisCell.mainText.text = [[self.lineArray objectForKey:row] valueForKey:@"lineText_en"];
- }
- NSIndexPath *thisCellPath = [NSIndexPath indexPathForRow:[sender tag] inSection:0];
- dialogue_cell *thisCell = (dialogue_cell *)[self.dialogueTable cellForRowAtIndexPath:thisCellPath];
- cell=[tableView dequeueReusableCellWithIdentifier:dialogueCellIdentifier];
Add Comment
Please, Sign In to add comment