Property Reflection
I've never felt the need to introspect properties in Objective-C code. At runtime, I care whether an instance variable exists so I can use it directly, or whether a method exists so that I can call it. Some applications may need to examine a little more of the semantics of properties. In particular, language bridges may find this capability useful.
The latest runtime allows you to add and modify properties, as well as simply inspecting them, and it adds some new introspection support. All of the new APIs make use of a new structure, objc_property_attribute_t, containing two fields: a name and a value. This structure replaces the property-type encoding strings that were used in the earlier APIs. Properties are now identified by a name and defined by an array of these structures.
This design makes it a bit easier to define property attribute parsers, because attributes that are not understood are easy to skip. Several property attributes, such as the instance variable name, contain an arbitrary-length string and use a special character as a terminator. It's not possible to add a new attribute like this to the string encoding without breaking all existing parsers. With the new system, a property-attribute parser can just ignore attributes with names that it doesn't recognize.
The new API for getting attributes in this format looks like this:
objc_property_attribute_t *property_copyAttributeList(objc_property_t property, unsigned int *outCount);
You're responsible for freeing the returned array, and you can quickly scan over the list to find the properties that interest you. Unfortunately, no way is provided to interrogate an objc_property_t for a specific attribute; you have to get all of the attributes and check them.
Most of the new APIs in OS X 10.7 are just filling in fairly obvious gaps. The ability to use blocks as IMPs is my favorite additionan API just begging for me to find some way of abusing itbut the others are going to be quite useful, if not especially exciting. The most exciting new feature, of course, is ARC, but most of the time you won't be interacting with the parts of the runtime that support it directly. Its entire point is that the compiler inserts these calls for you automatically.