I have “Man” class which also has 2 variable : “description” and “name”. At a point, I created Man class and initialize with its own variables (description and name) and pass it to NSMutableArray “collector”. How can I access description now ? I tried but ı could not get the property
Share
If I understand you correctly, the
Manobject will now be an object in thecollectorarray. If so, you would access it like:42is just an arbitrary index, andobjectAtIndex:is just one method to access an object in an array (any number of other ways could be used). In the second statement, I’ve also assumed that you have declareddescriptionandnameas properties of theManclass, so that they can be accessed from other classes via accessors/mutators (a.k.a getters/setters).