0

IS it work UICollictionview in IOS 5 error Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLayoutConstraint'

praveen
  • 13
  • 1
  • 3

3 Answers3

5

Check Availability of UICollectionView

Availability Available in iOS 6.0 and later.

You can go with PSCollectionView

Rajneesh071
  • 30,846
  • 15
  • 61
  • 74
5

UICollectionView is not directly available in IOS5.

However there is a nice open source control for adding UICollectionView support in IOS5. Its called PSCollectionView and you can find it here: PSTCollectionView

It is a drop in library that emulates UICollectionView on IOS5 and passes through on IOS6. Very nice and works very well.

best of luck.

NANNAV
  • 4,875
  • 4
  • 32
  • 50
CocoaEv
  • 2,984
  • 20
  • 21
  • 2
    Do you mean PSTCollectionView, which provides PSUICollectionView? => https://github.com/steipete/PSTCollectionView – Desty Aug 28 '13 at 17:28
  • 1
    thank you for your comment. I did mean PSTCollectionView. I updated the link in the answer. Great Library btw. – CocoaEv Aug 29 '13 at 18:54
3

In fact the problem probably isn't due to UICollectionView not being available in iOS5. It looks as though you're using constraints in Interface Builder. It is that that's causing the problem.

So, two things:

  1. Use something like PSTCollectionView to add UICollectionView support in iOS5
  2. Switch off constraints and revert to using "springs and struts" to resize/relocate your subviews
Stephen Darlington
  • 51,577
  • 12
  • 107
  • 152