Question

It always return a NULL instead of the property.

objc_property_t property = class_getProperty([UIView class], "frame");
XCTAssertTrue(property != NULL,
              @"UIView.frame property should be here.");

Works fine with center for example, but with frame seems not.

Can anybody explain this?

Was it helpful?

Solution

Whoa, seems it does not have such property indeed, but a method. Documentation shows as a property, but in reality it is a method. https://github.com/JaviSoto/iOS7-Runtime-Headers/blob/master/Frameworks/UIKit.framework/UIView.h

Weird.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top