阅读背景:

如何在iOS(MVC)中避免使用同一模型对象的多个实例

来源:互联网 

I am working on a project in which I have a model that is used by several different views and thereby viewcontrollers. These viewcontrollers have no knowledge of each others' existence, nor do they have any relationship to each other. This means that I have a model* in each of the viewcontrollers and when the views are loaded, I allocate the model in each class and make the pointers point at it. Or short: I allocate my model n times in n classes that use it, which I think is a waste of memory (not that I will run out of memory, but I think it's bad practice).I am working on a project in which I have a mod




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: