问题描述一:
每一个接口对应的model的数据在进入对应的模块(视图)时,执行一次本地缓存加载;
执行缓存加载的实现在基类实现。
解决方案:
将dispatch_once_t设置为成员变量;
问题扩展:
每一个接口对应的model的数据在进程生命周期内只执行一次;
执行缓存加载的实现在基类实现:
解决方案:使用静态map与dispatch_once复合解决。
问题总结:
1、两个相互以来的对象,一定有一个对象是主参考对象。生命周期和实现以主参考对象为主。
2、static变量属于进程变量和模块变量。用于记录可重入模块的活动和区别。
分享问题:
系统本身提供了分享工程。
分享功能的本质是进城间的通信和数据交换。