0

I have an app that use auto layout, programmatically setting constraints.

While it work fine on iOS 9, it suddenly crash almost everywhere on iOS 7.

For example, it crashes on method:

 [cell updateConstraintsIfNeeded];

Then, in another place it crash on:

return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));

In console output is:

Break on objc_exception_throw to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.

Is anyone ever face same problem when launch iOS 9 auto layout app on iOS 7 device?

Evgeniy Kleban
  • 6,794
  • 13
  • 54
  • 107
  • 3
    Make sure you aren't using attributes that don't exist in iOS7. e.g. the margin attributes – Avi Jun 15 '16 at 11:05
  • @Avi how should i ckeck it? I use https://github.com/SnapKit/Masonry and i didnt remember i explicitly use margins – Evgeniy Kleban Jun 15 '16 at 11:06
  • You could also try following the advice given in the debug output and find exactly where the problem is. – Avi Jun 15 '16 at 11:08
  • When you compile App in Xcode, it should warn that some Auto Layout constraint attributes are not supported in iOS 7 – Raptor Jun 15 '16 at 11:09
  • @Raptor how exactly should i see warning for methods, depreceated in iOS 7? – Evgeniy Kleban Jun 15 '16 at 11:14
  • @EvgeniyKleban if you have played with the constraints or view elements in code, try checking each library method you used by clicking them with the cmd key. Some constraint methods or enums are defined in iOS8, or iOS9 wont work in iOS7(as expected). – Ersin Sezgin Jun 15 '16 at 11:17
  • @ErsinSezgin that may work, but, i would rather want a way to output all of methods that is not availible for current iOS version. – Evgeniy Kleban Jun 15 '16 at 11:19
  • There are compile warnings in Xcode. – Raptor Jun 15 '16 at 11:21
  • @Raptor i could not see any that actually may help, even when i have methods that only availible for iOS 8 and later.. – Evgeniy Kleban Jun 15 '16 at 11:24
  • @EvgeniyKleban the question you ask in the first place and the point we came is way too different, but googling it a bit gave me this answer try it. http://stackoverflow.com/questions/4676000/is-there-a-way-for-xcode-to-warn-about-new-api-calls/8919108#8919108 – Ersin Sezgin Jun 15 '16 at 11:32
  • @ErsinSezgin thank you i will try it. – Evgeniy Kleban Jun 15 '16 at 11:34

0 Answers0