Фон
Я делаю скриншот viewController и представляю его в collectionViewCell. Макет collectionViewCell горизонтальный, но когда я выбираю представление, затем поворачиваю устройство, а затем возвращаюсь к collectionView, макет становится вертикальным.
Для отладки: я поставил точку останова в своем коде, а в области отладки я попытался проверить вывод переменной, и именно здесь начало появляться предупреждение ниже.
**Warning:**
error: property 'modalPresentationStyle' declared with incompatible types in different translation units ('UIModalPresentationStyle' vs. 'UIModalPresentationStyle')
error: instance method 'modalPresentationStyle' has incompatible result types in different translation units ('UIModalPresentationStyle' vs. 'UIModalPresentationStyle')
error: property 'modalPresentationStyle' declared with incompatible types in different translation units ('UIModalPresentationStyle' vs. 'UIModalPresentationStyle')
error: instance method 'modalPresentationStyle' has incompatible result types in different translation units ('UIModalPresentationStyle' vs. 'UIModalPresentationStyle')
error: property 'modalPresentationStyle' declared with incompatible types in different translation units ('UIModalPresentationStyle' vs. 'UIModalPresentationStyle')
error: instance method 'modalPresentationStyle' has incompatible result types in different translation units ('UIModalPresentationStyle' vs. 'UIModalPresentationStyle')
note: declared here with type 'UIModalPresentationStyle'
note: instance method 'modalPresentationStyle' also declared here
note: declared here with type 'UIModalPresentationStyle'
note: declared here with type 'UIModalPresentationStyle'
note: instance method 'modalPresentationStyle' also declared here
note: declared here with type 'UIModalPresentationStyle'
note: declared here with type 'UIModalPresentationStyle'
note: instance method 'modalPresentationStyle' also declared here
note: declared here with type 'UIModalPresentationStyle'
error: 6 errors parsing expression
Я использую :-
- Версия Xcode: 7.1
- iOS: 9.1
Примечание. Тот же код, который я запускал в Xcode 6.4 с iOS8, работает без сбоев/предупреждений. Кроме того, мне удалось найти значения переменных в области отладки.
Больше информации :-
Точка останова – я поместил ее в приведенный ниже метод.
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];
UIViewController *viewController = (UIViewController *)_tabControllers[(NSUInteger)indexPath.row];
/* Trying to debug above viewController in debug area */
/* Some code is here also but of no use */
cell.contentView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
return cell;
}
Команда запущена в области отладки -
po viewController
Ожидаемый результат –
Значение viewController с деталями, такими как кадр, как обычно.
Фактический результат –
Выше упомянутое предупреждение.
Что я пытаюсь отладить —
Макет ячейки collectionView меняется автоматически (один под другим после поворота) в iOS 9, тогда как в iOS 8 макет (горизонтальный вид) был идеальным.
Заранее спасибо.
UIModalPresentationStyle
нигде в своем коде. - person Avi   schedule 16.11.2015