Dieser Code:iOS 9 Einschränkungsfehler
[self.collectionView setTranslatesAutoresizingMaskIntoConstraints: NO];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.collectionView
attribute:NSLayoutAttributeTop
relatedBy:NSLayoutRelationEqual
toItem:self.topLayoutGuide
attribute:NSLayoutAttributeTop
multiplier:1.0f
constant:1.0f]];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.collectionView
attribute:NSLayoutAttributeBottom
relatedBy:NSLayoutRelationEqual
toItem:self.bottomLayoutGuide
attribute:NSLayoutAttributeBottom
multiplier:1.0f
constant:0.f]];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.collectionView
attribute:NSLayoutAttributeLeading
relatedBy:NSLayoutRelationEqual
toItem:self.view
attribute:NSLayoutAttributeLeading
multiplier:1.0f
constant:0.0f]];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.collectionView
attribute:NSLayoutAttributeTrailing
relatedBy:NSLayoutRelationEqual
toItem:self.view
attribute:NSLayoutAttributeRight
multiplier:1.0f
constant:0.0f]];
Arbeit ist in Ordnung auf iOS 8 und iOS7 aber jetzt, wenn mit iOS9, wenn ich meine app laufen bekomme ich diesen Fehler:
Beenden app aufgrund nicht abgefangene Ausnahme 'NSInvalidArgumentException', Grund: '*** + [NSLayoutConstraint constraintWithItem: Attribut: relatedBy: toItem: Attribut: multiplier: constant:]: Es kann keine Einschränkung zwischen einem führenden/nachgestellten Attribut und einem rechten/linken Attribut gemacht werden. Benutze Vorlauf/Nachlauf für beide oder keine. '
Wenn ich diese Einschränkungen entfernen, funktioniert meine App gut. Also muss ich wissen, was das Problem ist und was von iOS8 auf iOS9 geändert wurde.
Danke das ist mein Problem gelöst, aber können Sie mir erklären, warum in iOS8 funktioniert es gut nicht in iOS9, was wurde geändert? – Chlebta
@Chlebta Bessere Parameterprüfung. – Sulthan