title: Introspection of Objective-C objects properties
body: <p><strong>Is it possible to programmatically get the properties of an object in objective-c without using the runtime methods?</strong> I only ask because it seems unnecessary to check it at runtime, when it won't be changing. 
  I'm thinking of something to this effect:</p>
  
  <pre><code>MyObject *foo = [[MyObject alloc] init];
  NSDictionary *propertiesNamesAndValues = [foo getAllProperties];
  </code></pre>
  
  <p>Currently my solution looks like this:</p>
  
  <pre><code>id currentClass = [MyObject class];
  NSString *propertyName;
  unsigned int outCount, i;
  objc_property_t *properties = class_copyPropertyList(currentClass, &amp;outCount);
  for (i = 0; i &lt; outCount; i++) 
  {
      objc_property_t property = properties[i];
      propertyName = [NSString stringWithCString:property_getName(property)];
      NSLog(propertyName);
      NSLog(@"%@",[foo valueForKey:propertyName]);
  } 
  </code></pre>