इस कोड:आईओएस 9 बाधा त्रुटि
[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]];
कार्य iOS 8 और iOS7 पर की ठीक है, लेकिन अब iOS9 साथ जब मैं अपने अनुप्रयोग चलाने जब मैं इस त्रुटि मिलती है:
समाप्त एप्लिकेशन ध्यान में न आया की वजह से अपवाद 'NSInvalidArgumentException', कारण: '*** + [NSLayoutConstraint बाधा WithItem: विशेषता: संबंधित: toItem: विशेषता: गुणक: निरंतर:]: एक बाध्यकारी विशेषता/दाएं/बाएं विशेषता के बीच एक बाधा नहीं बनाई जा सकती है। दोनों या न तो के लिए अग्रणी/पिछला उपयोग करें। '
जब मैं उन बाधाओं को हटाता हूं तो मेरा ऐप ठीक काम करता है। तो मुझे यह जानने की जरूरत है कि समस्या क्या है और आईओएस 8 से आईओएस 9 में क्या बदला गया है।
धन्यवाद इस मुद्दे को हल किया गया है, लेकिन क्या आप मुझे समझा सकते हैं कि आईओएस 8 में क्यों आईओएस 9 में ठीक काम नहीं किया गया है क्या बदला गया है? – Chlebta
@Chlebta बेहतर पैरामीटर जांच। – Sulthan