Accessing an NSMutableArray in another class from a class
What would be the best way to access an NSMutableArray and its associated objects from within a开发者_开发知识库 different class? Should I write accessor methods to return the components I need or can I somehow assign a pointer to it from within the class I need to access it from?
this is pretty dependent upon the situation. I personally favor properties for stuff like this. You can just declare an @property, and then @synthesize it in the implementation file. Very little code.
精彩评论