Why is there no way to do introspection in Objective C with Objects?

Posted by user346741 on Stack Overflow See other posts from Stack Overflow or by user346741
Published on 2010-05-21T04:07:50Z Indexed on 2010/05/21 4:10 UTC
Read the original article Hit count: 271

I have seen examples (on here especially) of calling hideous C functions and getting structures back that have to be iterated, replete with reams of underbars.

Why can't I do this (pseudo to follow):

  Money *cost = [[Money alloc] init];

  for (Property *property in [[cost class] properties]){
    ..
  }

  for (Method *method in [[cost class] methods]){
    ..
  }

?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about reflection