objective c - Cocoa - Determining a class' properties at run time -


Is it simple? I'm actually trying to monitor if an object changes (to determine that I should save it). Currently I have a list of all the redlight properties in the object, then after creating the object I mean through I connect loops and supervisors to:

 For  (_setting * _barver in the observer) {{auto addObaserver: self-paced: supervisor option: NSKeyValueObservingOptio NNew | NSKeyValueObservingOptionOld Reference: Zero]; }   

This works, but if you forget to add an asset to the array, then obviously the supervisor will not be asked. Does anyone know how can I just set the properties of the object in runtime? I was thinking that this reaction could be around. Two-Selector: But I could not find much on this subject.

Thanks in advance!

After the synthesis of one object, behave almost ordinary objects, so that You can check the following

  if ([MyObject Responds: To-Selector: @Sillector (Properties Name)]) {// Your Code Here}   < P> or if you want to use the string as the selector's name:  
  ([MyObject answers the sender: NSSelectorFromString (@ "propertyName")]} {// your Code here}   

here propertyName is a gate (this is exactly the signature name on your declared property name), so if you want to check the presence of setter , Then you should add additional expressions:

  [myObject responseToSelector: @selector (setPropertyName :))    

Comments