My project is having an iOS8 compatibility issues in a custom UITableViewCell
. I am getting the following error
Assertion failure in -[EditableTextCell _setHostsLayoutEngine:], /SourceCache/UIKit/UIKit-3318.16.25/NSLayoutConstraint_UIKitAdditions.m:2760
2015-02-10 23:23:16.959 App_name[2883:507063] *** Terminating app due to uncaught exception
'NSInternalInconsistencyException', reason: 'Must translate autoresizing mask
into constraints to have _setHostsLayoutEngine:YES.'
I have seen similar questions such as UITableViewCell throwing exception and other questions like UITableview Cell exception - 'Must translate autoresizing mask into constraints to have _setHostsLayoutEngine:YES but none have been helpful. I have removed the constraints and I still get the error.
I am using auto layout. EditableTextCell mentioned in the error above is a custom UITableViewCell
with UITextFieldDelegate
and I am using it in many xib files. My view hierarchy is as follows:-
View_Portrait
- Portrait_TopContentView
- Editable Text Cell -- this is the custom class EditableTextCell
- Content View
- Table View Cell
- Content View
- Button
- Editable Text Cell -- this is the custom class EditableTextCell
- Portrait_TableContainerView
- portrait _Tab Bar
- UITabBarItem1
- UITabBarItem2
- Portrait_TopContentView
Similar structure for the landscape view.
I would really appreciate any help. Please let me know if I can provide more information.
UPDATE: I have tried some solutions but this is still not working for me. Before I setFrame:
for the EditableTextCell I put the following lines of code:
[self.pSearchEditCell setTranslatesAutoresizingMaskIntoConstraints:YES];
[self.pSearchEditCell.textField setFrame:textFieldFrame];
[self.pSearchEditCell.textField layoutIfNeeded];
where pSearchEditCell
is the custom table cell of UITableViewCell
and has the UITextField
. But this approach is not working for me.