Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- NSString *cellIdentifier = kOddCellIdentifier;
- CustomCell01 *oddCell = (CustomCell01 *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
- oddCell.myTextfield.delegate=self;
- oddCell.myTextfield.tag = indexPath.row;
- oddCell.myTextfield.text=[[self.Page01dataArray objectAtIndex:indexPath.row]objectForKey:@"value"];
- bool editable = [[[self.Page01dataArray objectAtIndex:indexPath.row] objectForKey:@"editable"] boolValue];
- if (editable==true) {
- oddCell.myTextfield.textColor=[UIColor redColor];
- } else {
- oddCell.myTextfield.textColor=[UIColor blackColor];
- [oddCell.myTextfield setBorderStyle:UITextBorderStyleNone];
- oddCell.myTextfield.enabled=NO;
- }
- [oddCell.myTextfield addTarget:self action:@selector(updateField:) forControlEvents:UIControlEventEditingDidEnd];
- return oddCell;
- }
- [nextTFarray addObject:oddCell.myTextfield];
- - (BOOL)textFieldShouldReturn:(UITextField *)textField {
- int i=[nextTFarray count];
- int x=textField.tag+1;
- UITextField *nextTextField = (UITextField *)[nextTFarray objectAtIndex:x];
- if (x<i-1) {
- [nextTextField becomeFirstResponder];
- } else {
- [textField resignFirstResponder];
- }
- return YES;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement