Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > iOS > TextField на CustomCell почему-то неактивно.


Автор: Dimanoss 30.8.2013, 13:29
Таблица состоит из , CustomCell-ячеек (TableViewCell), на которых расположены текстовые поля (для ввода значения).  Почему-то при клике на поле ничего не происходит (ни поле активным не становится, ни клавиатура виртуальная не вылетает).  Более того, на 100% не уверен, но вроде бы и программно это поле не меняется.

Автор: Bitter 30.8.2013, 14:44
Ошибка в 17й строке

Автор: Dimanoss 30.8.2013, 14:58
ээээ... мммм...  а я разве код показывал?  smile 

Автор: Bitter 30.8.2013, 15:21
Да не это я просто включил телепата.
Откуда кто знает что вы там пишете и что вы там делаете в ксибах? Это известно только вам, а хотите чтоб вам подсказали решение проблемы...

Автор: Dimanoss 30.8.2013, 15:35
ммм... ирония вполне законна, спасибо... smile 

хорошо.  код в Контроллере:
Код


- (UITableViewCell *) tableView:(UITableView *) tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSUInteger row = [indexPath row];
    NSMutableDictionary* tmpDict = [groupsArray objectAtIndex:row];

    static NSString *identID = @"GroupCell";
    GroupCell* cell = nil;
    cell = (GroupCell *) [tableView dequeueReusableCellWithIdentifier: identID];
    
    if(!cell)
    {
        NSArray* topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"GroupCell" owner:nil options:nil];
        for (id currentObject in topLevelObjects)
        {
            if ([currentObject isKindOfClass:[GroupCell class]])
            {
                cell = (GroupCell *) currentObject;
                break;
            }
        }
    }
    
    cell.groupId.text = [tmpDict objectForKey:@"collection_id"];
    cell.groupName.text = [tmpDict objectForKey:@"name"];
    
    return cell;    
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSUInteger row = [indexPath row];
    NSMutableDictionary* texts = [groupsArray objectAtIndex:row];
    
    MySingleton* st = [[MySingleton alloc] init];
    [st setArtgroupName:[texts objectForKey:@"name"]];
    [st setArtgroupId:[texts objectForKey:@"collection_id"]];
    
    ArticleViewController *ac = [[ArticleViewController alloc] initWithNibName:nil bundle:nil];
    ac.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentViewController:ac animated:YES completion:nil];
    
    return;
}


код ячейки:
Код

+(GroupCell *) cell
{
    NSArray* objects = [[NSBundle mainBundle] loadNibNamed:@"GroupCell" owner:nil options:nil];
    return [objects objectAtIndex:0];
}

+(NSString *) cellID {return @"GroupCell";}


объявление контроллера:

Код

@interface GroupViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)