Background
I'm taking screenshot of a viewController and presenting that in collectionViewCell. Layout of collectionViewCell is horizontal but as I select a view then rotate the device then later going back to collectionView the layout comes as vertical.
To debug: I put a break point in my code and in debug area I tried to check output of a variable, which is where the warning below started appearing.
**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
I'm using :-
- Xcode version: 7.1
- iOS: 9.1
Note- Same code I ran on Xcode 6.4 with iOS8 and it's running without a glitch/warnings. Also, I was able to find values for variables in debug area.
More Info :-
Break point - I put it in below method
- (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;
}
Command fired in debug area -
po viewController
Expected result -
Value of viewController with detail like frame as usual.
Actual Result -
Above mentioned warning.
What I'm trying to debug -
Layout of collectionView cell is changing automatically (one below another coming after rotation) in iOS 9 where else in iOS 8 layout (horizontal view) was prefect.
Thanks in advance.