dynamic - How to refer to instance properties at runtime in Objective-C -


A trick can be used to refer to the example properties on the ActionScript developers runtime, I was thinking that something similar Objective is in existence in C

In the actionscript we can:

  var thisObject; (Var i = 0; i & lt; 10; i ++) {This object = this ["My Intense Property" + i]; ThisObject.doSomething (); }   

I thought that there would be a way like this in Objective-C, but I could not find the mention anywhere. I'm looking for something on the pattern of:

 for  (int i = 0; i <10; i ++) {NSString * buttonName = [NSString string string with format: @ "Button_% i", i]; ID * thisButton = [self example documentationwith: stringname: button name]; ThisButton.label = @ "Button% i"; }   

Can you see what I'm doing? I have an XIB link view for IBotlets, and I want to refer those ioOletlets from within the loop, so I can add properties dynamically on the runtime.

Any thoughts? self corresponds to NSKeyValueCoding

< P> You can use the following > - which is by default for its example variable and property.
  NSButton * button = [self value ForKey: buttonName];    

Comments