Duncan C
Duncan C

Reputation: 131481

"Auto Layout before OS X 10.7"

I have an app in the app store, FractalWorks, which is based on a very old code-base. It's a big app, with quite a few screens. It was created in Objective-C before auto-synthesized properties were a thing, to give you an idea of how long ago it was created.

I wrote the app when I had a full-time gig as an independent software developer. I've since taken a day job, and support my apps in my spare time.

It still sells fairly well, and I recently used to add a section to the Wikipedia article on the Mandelbrot set on 3D images: https://en.wikipedia.org/wiki/Mandelbrot_set#3D_images_of_Mandelbrot_and_Julia_sets

I'm fluent in Auto-Layout now, but haven't taken the time to update the app's XIB files from "struts and springs" style to Auto-Layout - nor do I want to invest the time to do so if I can possibly help it.

I want to add a minor enhancement to the app that involves adding some UI elements and making one of the windows slightly taller. The minute I try to use Interface Builder to edit my XIB, it apparently silently changes it to Auto-Layout, and then complains about "Auto Layout before OS X 10.7". (It was released to the app store for OS X version 10.4, if memory serves, and I've moved the OS version up to the lowest version I could get away with in order to support legacy customers. It currently supports ≥10.6. The original, pre app-store version used even older OS versions.)

Googling this error suggests I use the file inspector on my XIB file to un-check a "Use AutoLayout" checkbox, but I don't see any such checkbox.

What am I missing?

If I use Xcode's code review button to compare the XIB file before and after editing it, various "tool version" values are changed, as well as it gaining a setting useAutolayout="YES". Editing that to read useAutolayout="NO" does not solve the problem.

Upvotes: 2

Views: 2032

Answers (2)

Dimitar Nestorov
Dimitar Nestorov

Reputation: 2604

All the credit goes to matt and his comment.

1. In the Navigator (left panel) go to issue navigator and click on the error.

2. In the Inspectors panel (right panel) the Size inspector will be automatically selected. Switch Layout from Automatic to Translates Mask Into Constraints.

Update: It's called Autoresizing Mask now.

Autoresizing Mask option

3. Repeat for every occurrence of this error.


You may end up with an error not in the Illegal Configuration group like the following which opens the All Messages view in the middle and doesn't open the Size inspector.

This is a compile time error, just build/run your app again.


And also from the previously mentioned comment:

Be careful not to make any constraints, as that will cause an incoherent situation.

Upvotes: 6

user14720571
user14720571

Reputation: 1

If you have multiple auto layout errors, which in all likelihood you will have, select all the controls in a window and perform the operation once rather than for each individual control. Repeat for each window.

Upvotes: -2

Related Questions