I just installed Xcode 5 and I am currently preparing my apps for release to the App Store on iOS 7 next week. I am getting a whole bunch of errors and warnings though.
In one app where I have a UIPickerView, UITextFields and a bunch of UILabels. In this app it gives an Illegal Configuration
(red) error on almost all controls in the storyboard file. I don't know what that error is or how to fix it. I would appreciate some help on that. I can't completely recreate the file because there are 20 complicated views.
In another app there is a UIScrollView containing a bunch of UILabels and UITextFields, plus one UITextView that is created programmatically and contains text based on what you selected in a (previous view) UITableView as well as resizing itself to fit the content. The UIScrollView resizes to accommodate for the new size of the UITextView. This one compiles and builds and the UITextView gets created but doesn't contain the text, probably because it now resizes incorrectly. The UIScrollView now also scrolls horizontally in addition to vertically which it isn't supposed to. This one gives only (yellow) warnings which all say:
Misplaced View Frame for "Label - Symbol:" will be different at run time.
for 4 controls including this Label and another, a Text Field and the Scroll View.
I would appreciate any help on this because this is the first time for me adjusting to a new version of Xcode and iOS.
P.S: Details on the Illegal Configuration
error include:Auto Layout on iOS Versions prior to 6.0
Thanks!
If you're still looking for an answer here, the answer is likely that you have either no constraints, or improper constraints, on your AutoLayout view.
You can fix this by selecting the view and going to the Xcode menu option: Editor -> Resolve Auto Layout Issues -> Add Missing Constraints / Reset to Suggested Constraints
.
You can also select the entire layout and do the same thing, this will reset all of the views on your layout to recommended constraints.
If you need to do custom constraints, you will have to set up your own auto layout constraints either in the Storyboard/XIB file, or manually in code.
For more information about Auto Layout, you can see Apple's documentation.
Finally, you can also turn off auto layout on the layout if you want it to appear as-is, with no automatic readjustments (this is not recommended).
Reset to Suggested Constraints
sometimes does not get rid of this warning. The solution is to select Placeholder
in the Intrinsic Size
drop down menu in the Size inspector of the UIView in question. And then add the missing constraints as needed.
Simply select your view controller Go to
Editor-->Resolve Autolayout issues--> Clear All Constraints in ViewController and you are done.
Regarding Frame "Label frame will be different at run time" -- Please see the release notes under Autolayout: Runtime.
https://developer.apple.com/library/prerelease/ios/releasenotes/DeveloperTools/RN-Xcode/index.html#//apple_ref/doc/uid/TP40001051
Full answer will be shown here after the NDA is lifted.
Note: this also happens under Xcode 4.2 as well, but the problem isn't surfaced by IB.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With