开发者

Accessing an NSMutableArray in another class from a class

开发者 https://www.devze.com 2022-12-19 21:57 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消