Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QuestionCell *qc = (QuestionCell*)[questionsTable cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
- NSLog(@"qc %@",qc); // Gives "qc (NULL)" if there's text in the custom cell
- #import <UIKit/UIKit.h>
- @interface QuestionCell : UITableViewCell
- @property (weak, nonatomic) IBOutlet UILabel *correctionLabel;
- @property (weak, nonatomic) IBOutlet UIImageView *correctionMark;
- @property (weak, nonatomic) IBOutlet UILabel *pronounLabel;
- @property (weak, nonatomic) IBOutlet UITextField *answerInput;
- @end
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- if (indexPath.section == 0)
- {
- QuestionCell *cell = nil;
- cell = [tableView dequeueReusableCellWithIdentifier:@"QuestionCell"];
- NSString *pronoun = nil;
- switch (indexPath.row) {
- case 0:
- pronoun = @"je";
- break;
- case 1:
- pronoun = @"tu";
- break;
- case 2:
- pronoun = @"il";
- break;
- case 3:
- pronoun = @"nous";
- break;
- case 4:
- pronoun = @"vous";
- break;
- case 5:
- pronoun = @"ils";
- break;
- default:
- break;
- }
- cell.pronounLabel.text = pronoun;
- return cell;
- }
- if (indexPath.section == 1)
- {
- ActionCell *cell = nil;
- cell = [tableView dequeueReusableCellWithIdentifier:@"ActionCell"];
- return cell;
- }
- return nil;
- }
Add Comment
Please, Sign In to add comment