Odd Constraint Crash

I had a container control on a screen. It had some controls and properties.

When the screen opened it crashed. Something to do with a constraint (from what I could see in the stack).

After some time (basically recreating the container one control and property at a time) I discovered the problem: I had added a property named “name.” Why this aftected a constraint I don’t know.

Anyway, things appear functional again.

Hope this helps someone,.

Because views already have a property named “name” and constraints use those names for setting up the relationships.

Greg,

In that case I would expect an error message at compile time. What happens is that when one attempts to show the screen you get a nil object error. It’s only because I have a little bit of code that catches unhandled exceptions that I was able to get some idea of the problem.

There’s no way for the compiler to know what’s going to happen at runtime because of a shadowed property AFAIK.

You’re lucky that it’s a NilObjectException and something that can be caught. When you said “crash” I assumed it was an obj-c under or over constrained situation which causes an immediate framework crash.