UITextView не обнаруживает типы данных, если он не щелкнут дважды

Недавно я столкнулся со странной ошибкой в ​​UITextView, из-за которой UIDataDetectorTypeAll не работает в моем приложении для iPad, пока UITextView не будет дважды щелкнут.

Мой код выглядит следующим образом:

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.

    [self setTitle:@"How To Use"];

    UITextView *textV1 = [[UITextView alloc] initWithFrame:self.vPlaceholder.frame];

    if (IS_IPHONE_5)
    {
        [textV1 setContentSize:CGSizeMake(self.vPlaceholder.frame.size.width, 800)];
        [textV1 setFont:[UIFont systemFontOfSize:14.0f]];
    }
    else if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
    {
        [textV1 setContentSize:CGSizeMake(self.vPlaceholder.frame.size.width, 700)];
        [textV1 setFont:[UIFont systemFontOfSize:14.0f]];
    }
    else
    {
        [textV1 setContentSize:CGSizeMake(self.vPlaceholder.frame.size.width, self.vPlaceholder.frame.size.height)];
        [textV1 setFont:[UIFont systemFontOfSize:24.0f]];
    }

    [textV1 setText:@"The ShoreUpdate App allows you to locate, record and submit information about archaeological sites at risk from coastal erosion. There are three main options from the home screen: \n \nShoreUpdate Map - This screen displays over 12,000 coastal archaeological sites as clustered points. Locate sites by zooming into clusters to reveal the details and recording forms of individual sites. if you have obtained the Site ID from the SCH@RP website you can also type the ID into the search bar. You can then choose to record the condition of the site by completing the form directly, or by downloading the form to your device for later us (this also means you are not dependent on a phone signal when on location). \n \nDownloaded Forms - This screen displays any forms that you have previously downloaded. Or, if you know the Site ID / Name, you can search for it using the bar at the top to access the form. You can also use this screen to submit your completed forms by selecting the Upload option. \n \nAdd Heritage Site - This screen enables you to records and submit a new site to the SCH@RP website. \n \nFeel free to email any comments or issues to [email protected] \n \nWatch our video tutorial at http://www.youtube.com/watch?v=PILS_Sl3SVQ"];

    [textV1 setEditable:NO];
    [textV1 setBackgroundColor:kBlueColor];
    [textV1 setTextColor:[UIColor whiteColor]];
    [textV1 setScrollEnabled:YES];
    [textV1 setUserInteractionEnabled:YES];
    textV1.dataDetectorTypes = UIDataDetectorTypeAll;

    [self.view addSubview:textV1];
}

Как видите, UITextView не настроен на редактирование и т. д., поэтому проблем быть не должно. Более странным является то, что и iPhone5, и iPhone сразу определяют типы данных.

Кто-нибудь сталкивался с этим или есть предложения, как это исправить?

Спасибо


person Elliott D'Alvarez    schedule 03.10.2013    source источник
comment
Точно такая же проблема, и подтвердите, что поведение только на iOS 7. iOS6 и более ранние версии работают правильно.   -  person Darren Oster    schedule 17.10.2013
comment
Я знаю, что это устарело, но проверьте этот вопрос: в iOS 7"> stackoverflow.com/questions/18962742/   -  person carloabelli    schedule 18.01.2014